3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'aktuell/blog/cat1/cat2/cat3'; $uri_arr = explode("/",$str); $cat = array(); array_map(function($v) use (&$cat){ preg_match('/^cat\d$/',$v,$matches); if(count($matches) > 0){ $cat[] = $matches[0]; } },$uri_arr); print_r($cat);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
168.08 ms | 2759 KiB | 14 Q