我有一个字符串,如'Hello link to page 17 link to link to page 3 link to page 10 link to page 13 link to page 16你好吗?我想使用php正则表达式将''链接到第1页','链接到第3页'等替换为''来自此字符串。 Plz的帮助。谢谢..
答案 0 :(得分:0)
试试这个:
$string="'Hello link to page 17 link to page 1 link to page 3 link to page 10 link to page 13 link to page 16 How are you?' I want to replace 'link to page 1', 'link to page 3'";
echo preg_replace("/link to page \d+/","",$string); //