php 正则处理 两个字符串间的数据
$str=' this is my string{parent_id} hello';if( preg_match("/{(.+?)}/isU",$str,$res)) echo $res;
#print_r($res);
结果输出parent_id
#另一种方法更好,有{} () [] <>都可以
$str = '中文abcd123${1,2,3,4,5}.jpg444<44g>44.124(j)12g4';
$search ='/[{(\[<](.*?)[})\]>]/';
if( preg_match($search,$str,$res)){
print_r($res);
}
页:
[1]