This is a discussion on snprinf within the PHP Language forums, part of the PHP Programming Forums category; hi in c language, i do: char tmp_mnt_dir_www[75]; snprintf(tmp_mnt_dir_www, sizeof(tmp_mnt_dir_www),"%s/makehtml.lock", mnt_dir_www); how ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
collinm wrote:
> hi > > in c language, i do: > > char tmp_mnt_dir_www[75]; > snprintf(tmp_mnt_dir_www, sizeof(tmp_mnt_dir_www),"%s/makehtml.lock", > mnt_dir_www); > > how to do the same thing in php? > $tmp_mnt_dir_www = sprintf("%s/makehtml.lock", $mnt_dir_www); $tmp_mnt_dir_www = substr($tmp_mnt_dir_www, 0, 75); (or possibly 74, I can't be bothered to work out whether you've included space for null-terminator or not) -- Oli |