Hello everyone.
Back with a pretty simple question regarding functions in PHP. Granted,
still learning here and just trying to 'understand' what goes on and how
it works.
Here is a little simple piece of code that I have a question on:
<?php
$number = 50;
function tenTimes()
{
global $number;
$number = $number * 10;
}
tenTimes();
print $number;
?>
This displays 500 in a browser. Simple enough. I just have a question on
the 3rd to last row:
tenTimes();
I know that this is the name of the function, and everything within the
{} is what I defined for the tenTimes function...
But, why is tenTimes(); called at the bottom? I know if I remove it,
'50' is displayed in the page.
For some reason, I seem to having a tough time getting my head wrapped
around this. Could be that I am tired and need a break. :)
Can someone break that down for me? I appreciate it.
Jason