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') ) 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? 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
Archived
This topic is now archived and is closed to further replies.