Need PHP regular expression

user2470345

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 ..

Prasanth Bendra

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); //

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related