I’ve been working on this page and I’ve run into a problem. I can’t seem to find a way to get a variable created in a function passed on to code outside the function. thnx for the help.
@cdwhalley_comApr 26.2006 — #If that variable is the only one you want out of the function, return it.
E.g. [code=php] function create_hello($name) { $result = "Hello, ".$name."!"; return $result;//return the variable }
$hello_string=create_hello("Bob");//call the function to get the variable from it and assign it to a new variable outside of the function echo $hello_string; [/code] Would output Hello, Bob!