In Wordpress, every WP_query returns with posts. (in current situation I have 2 posts) Every post contains some array. As a result I get two arrays and I need to merge them so I could Sort them later. So currently if I print:
echo "<pre>";
print_r($products_selected);
echo "</pre>";
I get This:
Array
(
[0] => Array
(
[0] => http://www.page1.com
[1] => Product 1
)
[1] => Array
(
[0] => http://www.page2.com
[1] => Product 2
)
)
Array 2:
Array
(
[0] => Array
(
[0] => http://www.page3.com
[1] => Product 3
)
[1] => Array
(
[0] => http://www.page4.com
[1] => Product 4
)
[2] => Array
(
[0] => http://www.page5.com
[1] => Product 5
)
)
How do I merge them so I could sort by Product names ( [1] )
Example:
Array
(
[0] => Array
(
[0] => http://www.page1.com
[1] => Product 1
)
[1] => Array
(
[0] => http://www.page2.com
[1] => Product 2
)
[2] => Array
(
[0] => http://www.page3.com
[1] => Product 3
)
[3] => Array
(
[0] => http://www.page4.com
[1] => Product 4
)
[4] => Array
(
[0] => http://www.page5.com
[1] => Product 5
)
)