<?php $data = '{"data":"key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47"}'; preg_match_all('/(?:age=)([0-9]+)/', json_decode($data)->data, $matches, PREG_PATTERN_ORDER); if (array_key_exists(1, $matches)) { $greaterThan50 = array_filter($matches[1], function($age) { return intval($age) > 50; }); var_dump($greaterThan50); }
You have javascript disabled. You will not be able to edit any code.