Answer the question
In order to leave comments, you need to log in
How to solve a bug with php on localhost?
there is a code
$str = '{controller}/{action}';
$str = preg_replace('/\{([a-z]+)\}/', '(?P<\1>[a-z-]+)', $str);
echo $str;
(?P<controller>[a-z-]+)/(?P<action>[a-z-]+)
(?P[a-z-]+)/(?P[a-z-]+)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question