Ask a question about regular expressions
小松
小松 2018-05-07 11:21:58
0
0
1136

Look at other people’s PHP source code written like this
$template = preg_replace_callback("/[\n\r\t]*\{eval\s (. ?)\}[\n\r\t] */is", parse_template_callback_evaltags_2, $template);

function parse_template_callback_evaltags_2($matches) {
return stripvtags('<? '.$matches[2].' ?>','' );

I saw on the Internet that $matches[2] matches the second subexpression, but there is only one parentheses in preg_replace_callback. So what does $matches[2] match? I don’t have a deep understanding of functions and regular expressions, so sorry

小松
小松

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template