3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 'status' => 1, 'msg' => [ 'total_records' => 5, 'total_pages' => 1, 'page_number' => 1, 'per_page' => 100, 'return_count' => 5, 'page_result' => [ 0 => [ 'items' => 200052001, 'code' => 501, 'category' => 'watch', 'price' => 50, 'stock' => 1, ], 1 => [ 'items' => 200052001, 'code' => 401, 'category' => 'shirt', 'price' => 3, 'stock' => 1, ], 2 => [ 'items' => 200052001, 'code' => 172758801, 'category' => 'watch', 'price' => 200, 'stock' => 1, ], ], ], 'errcode' => 0, ]; function search($array, $key, $value) { $results = []; if (is_array($array)) { if (isset($array[$key]) && $array[$key] == $value) { $results[] = $array; } foreach ($array as $subarray) { $results = array_merge($results, search($subarray, $key, $value)); } } return $results; } $temp = search($arr, "category", "watch"); print_r($temp);die;
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [items] => 200052001 [code] => 501 [category] => watch [price] => 50 [stock] => 1 ) [1] => Array ( [items] => 200052001 [code] => 172758801 [category] => watch [price] => 200 [stock] => 1 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.15 ms | 1712 KiB | 4 Q