3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = array(); //$json = file_get_contents ('php://input'); $json = '[{"friends_with_accepted":"false","friends_with_synced":"false","friends_with_second_id":"5","friends_with_first_id":"6"}]'; $jsonArray = json_decode ($json, true); foreach ($jsonArray as $jsonObject) { $firstId = $jsonObject['friends_with_first_id']; $accepted = $jsonObject ['friends_with_accepted']; $secondId = $jsonObject ['friends_with_second_id']; $synced = $jsonObject ['friends_with_synced']; echo "accepted: ".$accepted."synced: ".$synced; }

preferences:
33.35 ms | 402 KiB | 5 Q