0

program2.php

<html>
<header>
</header>

<body>

<?php 

function Multiply($x, $y)
    {
    echo $x * $y;
    }

echo 'Multiply : '.Multiply(2,3).'<br><br>';

?>  

</body>

</html>

Why the result of the above program is :

6Multiply :

instead of

Multiply : 6

Any clue?

3
Contributors
2
Replies
19
Views
3 Months
Discussion Span
Last Post by jstfsklh211
0

In this example it's all about order of execution. Line will have to call Multiply() to make the output string and since your function echo'd something then your example shall echo the mulitiple first then your line 14 text is output.

I see no mystery here at all.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.