function getvars($varstring) { $vararray = array(); while($string = strtok($varstring," ") { if (substr($string,0,1) == "\$") { $vararray[] = $string } } return $vararray; }