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. 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] Link to comment https://forums.phpfreaks.com/topic/11111-create_function/#findComment-41550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.