On Mon, 2005-01-31 at 20:41, 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?
> 
> And:
> 
>       print(supscript("3")."2");
> 
>       makes the 2 appear before the 3.
>       I am confused!

Your second example does not print the 2 before the 3. And the reason
your first example prints the 3 before the 2 is because the the print
inside the function prints first because the print that contains the
call to it can't print until it receives the return value form the
function. What you probably want is the following:

function supscript($texto)
{
   return "<sup>".$texto."</sup>";
}

print "2".supscript("3");

-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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

Reply via email to