<?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);
You have javascript disabled. You will not be able to edit any code.