Here is a snippet of a cURL result:
<?php
$json_result_from_curl = <<<EOD
{"status":"success","sku":{"items":"hammer","color":"green"},"refreshReady":false,"listing":[{"VendorId":"129","VendorName":"Allen","Price":78.75,"UpdatedOn":"2020-11-05 00:29:13"},{"VendorId":"16","VendorName":"Greg","Price":4.39,"UpdatedOn":"2020-11-05 02:15:06"},{"VendorId":"282","VendorName":"Carol","Price":0,"UpdatedOn":"2020-11-05 02:15:06"},{"VendorId":"5dd0","VendorName":"Susan","Price":.50,"UpdatedOn":"2020-11-05 02:15:06"},{"VendorId":"6","VendorName":"Thomas","Price":100.00,"UpdatedOn":"2020-11-05 02:15:06"}]}
EOD;
I figured out how to use preg_match_all to match what I want with this line of code:
preg_match_all('/VendorName":"(.*?)\",.+?([0-9\.]+)/',$data,$matches);
But how do I loop through to get the following result?
Allen 78.75
Greg 4.39
Carol 0
Susan .50
Thomas 100.00