Re: [PHP] Problems with sprintf and swapping variables
> Happy %2/$d'th birthday %1/$s. > > like the docs says your supposed to do it doesn't work and all you see is: > Happy $d'th birthday $s. > > What is up with this.. if you use %2/%d it sort of works, but it throws all > my other variables out of whack.. any help with this would be appreciative.. I'm guessing you need to escape that $ with a \ using addslashes(). -- WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problems with sprintf and swapping variables
Ok.. now I hope that somebody can help with this one... I'm trying to write a form field on a webpage that makes data entry of ever changing fields easy.. In otherwords: Enter Style: You might enter: Hello %s, how are you today.. I am fine.. I here you are turning %d. Now this works when you pass sprintf($text, $name, $age); but if you in the text say. Happy %2/$d'th birthday %1/$s. like the docs says your supposed to do it doesn't work and all you see is: Happy $d'th birthday $s. What is up with this.. if you use %2/%d it sort of works, but it throws all my other variables out of whack.. any help with this would be appreciative.. later, Ed McLain [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]