passing new variables back from a function
| From: | Matt Williams | Date: | Thu, 07 Sep 2000 14:07:40 +0000 |
| Subject: | passing new variables back from a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15711@lists.php.net to get a copy of this message | ||
Hi
I am trying to write a function that will split a string a return the values
as new variables
Here's what I've got
function explode_var($varname)
{
$vararray = explode(":", $varname);
$name = $vararray['0'];
$valuecode = $vararray['1'];
}
explode_var($details);
echo "name = $name";
But it does not output anything. If I put the echo inside the function it
outputs correctly but I want to pass the variable back to the script so /i
can do other stuff to it.
Many thanks for any help
M@