php – How to arrange 2 simple array data-ThrowExceptions

Exception or error:

I have array data attached in below image and i want to show it exactly like


[0] => Array
        [title] => VALID Act Introduction Advances Diagnostics Regulatory Reform
        [link] =>

[1] => Array
        [name] => MedTech Fighting Coronavirus on Multiple Fronts
        [category] =>

[2] => Array
    [title] => EPA Ethylene Oxide Value at Odds with Public Health, Best Science
    [link] => abc
How to solve:

Lets say your first data stored in $Title array and second one stored in $Link array. Now populate those in $Data array.

$Data = [];
foreach($Title as $key=>$value){
      $Data[] = [

in $Data you’ll get your desired output.


so finally below is my solution. we just need to sort it out with array map function.

$results = array_map(null , $title, $url);

Leave a Reply

Your email address will not be published. Required fields are marked *