sKunKbad Posted April 19, 2009 Share Posted April 19, 2009 If I have a variable that holds some text: $output = "<p>"; and then want to add to that variable with printf $output .= printf(....); then print: print $output; it doesn't work. it prints what is inside printf before what was in $output, and what was in printf is not in $output. Is what I want to do possible? I'm really just adding a string to a string. Quote Link to comment https://forums.phpfreaks.com/topic/154764-solved-printf-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 19, 2009 Share Posted April 19, 2009 That's because printf(....) sends the output to the browser, like it states in the php manual. You want sprintf(....) Quote Link to comment https://forums.phpfreaks.com/topic/154764-solved-printf-question/#findComment-813848 Share on other sites More sharing options...
sKunKbad Posted April 19, 2009 Author Share Posted April 19, 2009 Hey, thanks! I'm not up to speed on my printf and sprintf. I appreciate your quick answer. Quote Link to comment https://forums.phpfreaks.com/topic/154764-solved-printf-question/#findComment-813851 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.