silkfire Posted December 12, 2012 Share Posted December 12, 2012 I have this simple problem. How do I convert an array from this: array('item1', 'item2', 'item3'); to array( array('value' => 'item1'), array('value' => 'item2'), array('value' => 'item3') ) Quote Link to comment https://forums.phpfreaks.com/topic/271911-make-each-value-an-array/ Share on other sites More sharing options...
Jessica Posted December 12, 2012 Share Posted December 12, 2012 $arr = array('item1', 'item2', 'item3'); $newarr = array(); foreach($arr AS $a){ $newarr[] = array('value'=>$a); } Why? Quote Link to comment https://forums.phpfreaks.com/topic/271911-make-each-value-an-array/#findComment-1398934 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.