需要从theme10
catalog/view/theme/theme10/
我试过了:
preg_match('|catalog/view/theme/(.*)/|',$html, $theme);
答案 0 :(得分:1)
$matches = [] ;
$pattern = "@catalog/view/theme/([a-zA-Z0-9]+)/{0,1}@" ;
$string = "catalog/view/theme/theme10" ;
preg_match($pattern, $string, $matches) ;
echo $matches[1] ;
最后使用/
和不使用{{1}}。