3v4l.org

run code in 300+ PHP versions simultaneously
<?php $members_login_history = '[{"i":"1","d":"2020-05-28"},{"i":"1","d":"2020-05-28"},{"i":"1","d":"2020-05-29"},{"i":"1","d":"2020-06-15"},{"i":"1","d":"2020-06-15"},{"i":"1","d":"2020-06-30"},{"i":"2","d":"2020-06-30"},{"i":"2","d":"2020-06-30"},{"i":"2","d":"2020-06-30"},{"i":"2","d":"2020-06-30"},{"i":"2","d":"2020-06-30"},{"i":"3","d":"2020-06-30"},{"i":"3","d":"2020-07-01"},{"i":"4","d":"2020-08-26"},{"i":"6","d":"2020-08-26"},{"i":"6","d":"2020-09-23"},{"i":"6","d":"2020-10-12"},{"i":"6","d":"2020-10-12"},{"i":"7","d":"2020-10-12"},{"i":"7","d":"2020-10-12"},{"i":"7","d":"2020-10-14"},{"i":"7","d":"2020-10-14"},{"i":"7","d":"2020-10-21"},{"i":"7","d":"2020-11-12"},{"i":"7","d":"2020-11-12"},{"i":"7","d":"2020-12-16"},{"i":"7","d":"2020-12-16"},{"i":"8","d":"2021-01-06"},{"i":"9","d":"2021-01-13"},{"i":"9","d":"2021-01-20"},{"i":"9","d":"2021-01-22"},{"i":"10","d":"2021-01-25"},{"i":"10","d":"2021-02-10"},{"i":"11","d":"2021-02-10"}]'; $id=4; preg_match_all("/i\":\"".$id."\",\"d\":\"([0-9-]+)\"/", $members_login_history, $matches); print_r($matches);
Output for 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
Array ( [0] => Array ( [0] => i":"4","d":"2020-08-26" ) [1] => Array ( [0] => 2020-08-26 ) )