Jump to content

[SOLVED] Passing value back through a function


Lokolo

Recommended Posts

I can't figure out how to do it.

 

so if i have this code

 

$count = 5;
somefunction($count);
echo "$count <br>";

--------------------

somefunction($count)
{
$count = 1000;
}

 

but obviously the echo will print off 5, not 1000, which is what I want.

w3schools goes on about the return syntax but that only works when the function is returning 1 value!

 

hope you can help (and understand what I am on about),

 

Lokolo

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.