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; } Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/171586-extacting-code-from-array/#findComment-904905 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.