BeastTheKidd Posted January 12, 2012 Share Posted January 12, 2012 So, I know that sprintf formats the values for variables, and makes it easier to read in my opinion. However, would I be correct to assume that if someone wanted to change a certain sentence, but still have all the variables update, it would work? Example: <?php $string = "Welcome Back, %s!"; //Add value for %s $var1 = sprintf($string,"John"); $var2 = sprintf($string,"Stan"); ?> Thanks, - Dillion Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 12, 2012 Share Posted January 12, 2012 yes for sure, but you don't even have to ask, try by yourself for such small things ;-) Quote Link to comment 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.