又问一个正则。。 http://***.com/thread-12345678-1-1.htmlhttp://***.com/thread-31241676-*-*.html这样的地址,把thread-后面的id取出来请问怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $s1 = 'http://***.com/thread-12345678-1-1.html';$s2 = 'http://***.com/thread-31241676-*-*.html';//这样的地址,把thread-后面的id取出来请问怎么写?$r = '/thread-(\d+)-/';preg_match($r, $s2, $a);echo $a[1]; 各位对PHP有什么见解 数据库的问题 加载php_gd.dll的问题 请问如何处理这项显示,有关javascript和php,使用于discuz论坛。 挂IRC送50分,准备散1000分,讨论PHP高级问题: htaccess问题 php文件上传问题 郁闷php5就剩90分了 分页显示 如何通过javascript实现动态计算 php+mssql:mssql_connect Unable to connect to server 关于ignore_user_abort
$s1 = 'http://***.com/thread-12345678-1-1.html';
$s2 = 'http://***.com/thread-31241676-*-*.html';
//这样的地址,把thread-后面的id取出来请问怎么写?
$r = '/thread-(\d+)-/';
preg_match($r, $s2, $a);
echo $a[1];