purencool Posted August 14, 2009 Share Posted August 14, 2009 I have been look at this code for 50mins and i can't work out why it won't work what I am trying to do is this. function a(){ arrayA check = function b(arrayA); } function b(arrayA){ do something return array } All I get is errors! Saying that array_push is looking for an array! function CreateMenu($directory) { // above sorts out array print_r($folderContents); // I get a full array at this point $folderContents1= MenuSort($folderContents); // this comes back empty print_r($folderContents1); // this shows nothing in the array array_push($folderContents1,"</ul>"); //because above is now empty error start $menufolderContents .= implode(" ",$folderContents1); return $menufolderContents; } function MenuSort($folderContents){ //Alphabetical order (sort array) // sort($menuCreation); //About Us //search //$key = array_search('Home', $menuCreation); //echo $key; echo "this is menu creation". $menuCreation; print_r($menuCreation); return $menuCreation; } Link to comment https://forums.phpfreaks.com/topic/170212-solved-passing-an-array-into-a-function/ Share on other sites More sharing options...
purencool Posted August 14, 2009 Author Share Posted August 14, 2009 found the issue I wasn't using the placeholder Link to comment https://forums.phpfreaks.com/topic/170212-solved-passing-an-array-into-a-function/#findComment-897881 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.