【发布时间】:2017-03-19 09:43:03
【问题描述】:
我有这句话
"My name's #jeff,what is thy name?"
现在我想从这句话中得到#jeff。
我试过这段代码
for ($i=0; $i <=substr_count($Text,'#'); $i++) {
$a=explode('#', $Text);
echo $a[$i];
}
但它返回#jeff,what is thy name?,这不是我的灵魂所渴望的
【问题讨论】:
标签: php regex string preg-match preg-match-all