<?php $string = "/companies/(\d+)/adverts/new/(\d+)"; preg_match_all('#\((.*?)\)#', $string, $matches); $search = $matches[0]; $replace = array(2223, 1111); $result = strtr($string, array_combine($search, $replace)); var_dump($result);
You have javascript disabled. You will not be able to edit any code.