像这样…
<?php$content ="<p>This is a sample text where {123456} and {7894560} ['These are samples']{145789}</p>";preg_match_all('/{(.*?)}/', $content, $matches);print_r(array_map('intval',$matches[1]));
输出:
Array( [0] => 123456 [1] => 7894560 [2] => 145789)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)