Re: simple question

From: Date: Tue, 01 Feb 2005 01:51:31 +0000
Subject: Re: simple question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207818@lists.php.net to get a copy of this message
Pagongski wrote:
I have this function: function supscript($texto) { print("<sup>".$texto."</sup>"); } But when i do: print "2".supscript("3"); I get the "3" before the "2", how is that posible?
Your function should return the value, not print it. The way you have it now, the function must be ran before the original string can be printed. That's why you see the 3 before the 2. function supscript($texto) { return "<sup>{$texto}</sup>"; } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#207818) next »