argument variable gets lost in function
| From: | Spunk S. Spunk III | Date: | Thu, 25 Oct 2001 14:32:49 +0000 |
| Subject: | argument variable gets lost in function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-72279@lists.php.net to get a copy of this message | ||
I'm assigning a variable a value from an associative array.
$variable = $array["key"]["value"];
Then passing the $variable to a function.
SomeFunction($variable)
The variable exists (can be printed) until a built-in function (within the
original function) is called.
echo "$variable"; //prints out fine
$variable2 = ereg_replace(" ", "_", "$variable");
echo "$variable"; //prints out NOTHING...
Why is this and how can I get around it?
Thanks,
Spunk