Q:

Need PHP regular expression

I have a string like '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' etc. with ' '  from this string using php regular expression . Plz help . Thanks ..

A:

Try this :
$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); //

