Monkuar Posted February 9, 2012 Share Posted February 9, 2012 $middle=array( "aboutme" => $aboutme, "signature" => $signature, "friends" => $f, ); foreach ($middle as $val =>$n) { $middlesection .= $middle[$val]; var_dump($middle[$val]); } Okay now How do I make this so my users can choose the ORDER of there profile sections? I: have a field in my db called "profile" varchar 255!I am so excited I am actually learning Foreach with arrays this is awesome! I am echoing out my $middlesection to display my 3sections: here is a screenshot: Now I just want my users to beable to change the order of the Array? how is this possible? I am so close, eventually I want them to beable to move the sections to the left or right (I would need a 3d array though) im not that smart yet :shrug: :shrug: Link to comment https://forums.phpfreaks.com/topic/256716-okay-i-am-finally-understanding-foreach/ Share on other sites More sharing options...
Monkuar Posted February 9, 2012 Author Share Posted February 9, 2012 $middle=array( "0" => $aboutme, "1" => $signature, "2" => $f, ); $order = array(1,2,0); print_r($middle); foreach ($order as $index) { $middlesection.= $middle[$index]; } LOL I FIGURED IT OUT!! AWESOME MAN LOVE IT THANKS!!!!! FOREACH IS JUST FREAKING EPCI!! Link to comment https://forums.phpfreaks.com/topic/256716-okay-i-am-finally-understanding-foreach/#findComment-1316049 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.