QAds
Motorola A1200 MING Smartphone
$112.49
Apple iPad 16gb Wi-Fi
$448.97
Motorola PEBL U6 Camera and Bluetooth
$85.95
Apple iPod shuffle 4 GB Mavi
$49.13
:: HOME PHP How can I remove links from content?
 
How can I remove links from content?
How can I remove links from content? I read some WEBsite content and it has so many links inside and I want to remove all links from it. how can I do that?
at first you need to take string between <a></a> tags and then you need to replace it. you can use below code to do that.

 
 
Code
$text = '.. content here ...';
$p1 = strpos($text, '<a href=');
$p2 = (strpos($text, '</a>') 4) - $p1;
$rep = substr($text, $p1, $p2);
echo str_replace($rep, '',$text);