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?

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.

change your function to return the value instead of echo

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.