Variables and Strings
| From: | PHP Superman | Date: | Thu, 29 Dec 2005 03:30:04 +0000 |
| Subject: | Variables and Strings | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-227949@lists.php.net to get a copy of this message | ||
Hey everyone, is there a way to return all the variables from a string into
an array, for example
$Var1="Yo";
$Var2="Man";
$SQL="SELECT * FROM tblname WHERE 4=$Var1 AND WHERE 3=$Var2";
$AllVars=MySpecialFunction($SQL);
print_r($AllVars);
would ideally print an array like:
{
array
$Var1="Yo"
$Var2="Man"
}
i think i should use an ereg or preg replace but I don't know much about
them or how to use them, thanks in advance