PHP 如何在一个正则表达式里使用变量?匿名 · 更新于 2014/1/2 $star='a'; $stop='c'; $info='a1b2c3'; $pattern='/'.$star.'(.+?)'.$stop.'/'; preg_match($pattern,$info,$result); print_r($result[1]); 上一篇PHP setcookie() 函数下一篇explode和split的区别