Delete links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bidoun
Forum Newbie
Posts: 7
Joined: Sun Nov 01, 2009 6:45 am

Delete links

Post by bidoun »

Hello

I would like to know how to delete links and may not appear click able on a string using preg_replace, I have a issue with regular expressions? Also how to delete images 'being click able or not' ?

Thank you
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Delete links

Post by klevis miho »

Try this

preg_replace('#<a(.+?)</a>#s', '', $string);
Post Reply