PHP模式取值 $str = "Layout15 : This is Testing"如何取出Layout后边的那个15呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //上次有人问过了,不知是不是你。。$str = "Layout15 : This is Testing";preg_match('/Layout(\d+)/', $str, $matches);echo($matches[1]); 是我啊,preg_match('/Layout(\d+)/', $str, $matches); 这个不对啊,取1位数可以,2位数不行 $selectedLayout = $_POST['ddLayout']; print_r($selectedLayout); //这句输出 Layout10: AA + BBpreg_match('/Layout(\d)+/', $selectedLayout, $matches);$layout = $matches[1]; echo $layout; //这句输出 0 , 肯定不对啦,应该是10 Layout(\d+),不够仔细呀。 能插进去英文却插不进去中文 如何用面向对像来做? php 上载问题 请教一个正则问题(100分求助) 急啊,饭碗问题 一个PHP分类数组循环问题 数据提交(菜鸟问题)——在线等! 随机码,验证码(基于gd)的代码,需要的请顶一下 update中能否使用in? 调查统计:php模板 学习php之前要做的工作(自学) 请教EAN13条码号怎么生成?懂的师傅进来教一下。
//上次有人问过了,不知是不是你。。
$str = "Layout15 : This is Testing";
preg_match('/Layout(\d+)/', $str, $matches);
echo($matches[1]);
$selectedLayout = $_POST['ddLayout'];
print_r($selectedLayout); //这句输出 Layout10: AA + BB
preg_match('/Layout(\d)+/', $selectedLayout, $matches);
$layout = $matches[1];
echo $layout; //这句输出 0 , 肯定不对啦,应该是10