I have the following array:
array (size=2)
0 =>
array (size=4)
0 => string 'http://localhost/wp/wp-content/uploads/2013/03/slider-area.jpg' (length=62)
1 => int 1584
2 => int 346
3 => boolean false
1 =>
array (size=4)
0 => string 'http://localhost/wp/wp-content/uploads/2013/03/featured.jpg' (length=59)
1 => int 1584
2 => int 346
3 => boolean false
My Question is that how can I loop through this array to generate a new array that contains only two values as following:
$result_array = array(
0 => "http://localhost/wp/wp-content/uploads/2013/03/slider-area.jpg",
1 => "http://localhost/wp/wp-content/uploads/2013/03/featured.jpg"
);
I have tried a foreach loop but could not get the required result array. I tried the following loop:
foreach ( $array as $key => $value ){
foreach ( $value as $item){
$result_array[] = $item;
}
}