sjade1 Posted June 3, 2006 Share Posted June 3, 2006 I'm trying to create a function to take care of explode$characterExploder = create_function('$a', 'return list($cName, $cImage, $cDescription) = explode("|",$a);');$data = "Jack|picture.jpg|about Jack";$characterExploder($data);echo"1: $cName<br>2: $cImage<br>3: $cDescription";Returns:1:2:3:They're all blank...not sure why..?Any help would be appreciated, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/11111-create_function/ Share on other sites More sharing options...
Barand Posted June 3, 2006 Share Posted June 3, 2006 Variable scope.Variables created inside a function are local to that function and not available outside it.[a href=\"http://us3.php.net/manual/en/language.variables.scope.php\" target=\"_blank\"]http://us3.php.net/manual/en/language.variables.scope.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/11111-create_function/#findComment-41550 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.