By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,408 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,408 IT Pros & Developers. It's quick & easy.

snprinf

P: n/a
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?

thanks

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.