3
我想查找字符串中“%”中的所有子字符串,但我不明白为什么它只能找到“id”。正则表达式找到%PHP内的所有子字符串
$test = '<img src="%get_love%" alt="%f_id%" title="%id%" />';
$token_regex_inside_tags = "/<([^>]*%([\w]+)%[^>]*)>/";
preg_match_all($token_regex_inside_tags, $test, $matches);
感谢您的详细解释! – coffeeak