3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $content = '{"ORDERLIST":"{\"ORDER_LIST\":[{\"order_id\":\"1755\",\"uname\":\"jordan\",\"prod_name\":\"ABC\",\"quantity\":\"1\",\"branch\":\"Dapitan\",\"totalPrice\":\"23500\"]}"}'; $response = json_decode($content, true); $orderlist = json_decode($response['ORDERLIST'], true); //var_dump($orderlist); //count(var_export($orderlist)); $count = count($orderlist); echo "Count: $count"; //foreach($orderlist AS $row){ // echo $row[0]['order_id']; //echo $row[0]['uname']; //echo $row[0]['prod_name']; //echo $row[0]['quantity']; //echo $row[0]['branch']; //echo $row[0]['totalPrice']; //}
based on iQtch
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/3Cjt0 on line 7 Count: 0
Output for 5.5.0 - 7.1.10
Count: 0