21,886
社区成员
发帖
与我相关
我的任务
分享
//楼主是想取得两者之间的字符串吧
$str = "# #123 # #哈哈哈哈#";
$strArr = explode("#",$str);
//将数组最后一个单元弹出
$strArr = array_pop($strArr);
//将数组开头的单元移出数组
$strArr = array_shift($strArr);
//过滤空数组
$strArr = array_filter($strArr);
$str= "# #123 # #哈哈哈哈#232#";
$reg ='~(?<=#)(?:(?=[^\s]+))(.*?)(?=#)~';
preg_match_all($reg,$str,$m);
print_r($m[0]);