Re: simple question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux