PHP Json values with a specified label
If you are decoding your json into an object you can do it like that.
$list_array = json_decode('[{"product_name":"Product 1","product_quantity":"1","product_price":"2.99"}]');$result_html = '';foreach($list_array as $p){ $result_html .= '<div>Product: '.$p->product_name.'</div>'; $result_html .= '<div>Quantity: '.$p->product_quantity.'</div>';}echo $result_html;