<code><span>//preg_match,preg_match_all</span><span>$pattern</span> = <span>'/[0-9]/'</span>; <span>$subject</span> = <span>'y1jp78yn16ww55'</span>; <span>//定义两个空数组</span><span>$m1</span> = <span>$m2</span> = <span>array</span>(); <span>$t1</span> = preg_match(<span>$pattern</span>,<span>$subject</span>,<span>$m1</span>);<span>//$m1输出的是一维数组;把返回值赋给$t1</span><span>$t2</span> = preg_match_all(<span>$pattern</span>,<span>$subject</span>,<span>$m2</span>);<span>//$m2输出的是二维数组;把返回值赋给$t2</span> show(<span>$m1</span>);<span>//使用show函数进行调试输出</span><span>echo</span><span>'<hr />'</span>; show(<span>$m2</span>); <span>echo</span><span>'<hr />'</span>; show(<span>$t1</span>.<span>'||'</span>.<span>$t2</span>);<span>//匹配到的次数</span></code>
').text(i));
};
$numbering.fadeIn(1700);
});
});