purencool Posted August 24, 2009 Share Posted August 24, 2009 Below is a while loop that dynamically generates about ten if statements. But I have know idea how to get the if statements is go through the php engine. I know I have to implode the array.l but what do I do next ? // sets the path $x = $subdir.$folderItem; // put into if into array $folderContents[] = "if($getVar == $folderItem){ include( $x); }"; This is the code that implodes the arrays function ShowPage($menuArray) { // This makes the selection for the page reset($menuArray); while (list($key,$value) = each($menuArray)) { if(!is_numeric($key)) { //! means not, no need for extra else. if (is_array($value)) { $menuArray[$key]= implode($value); } } } $returnValue = implode($menuArray); return $returnValue; } Link to comment https://forums.phpfreaks.com/topic/171586-extacting-code-from-array/ Share on other sites More sharing options...
ignace Posted August 24, 2009 Share Posted August 24, 2009 but what do I do next? eval Link to comment https://forums.phpfreaks.com/topic/171586-extacting-code-from-array/#findComment-904905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.