note 34340 deleted from function.ereg-replace by didou
| From: | didou@php.net | Date: | Wed, 24 Sep 2003 17:16:35 +0000 |
| Subject: | note 34340 deleted from function.ereg-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57059@lists.php.net to get a copy of this message | ||
Note Submitter: devnull@hotmail.com
----
A couple of handy little snippets I've found/found and dabbled with for my own uses :-
1/ Remove all image tags from HTML (i.e. if you are pulling data from another site, and wish to
re-display it minus images) :-
$data=preg_replace("'<IMG[^>]*?>.*?>'si", "", $data);
2/ Remove all links BUT leave the text within the link intact (i.e. if you want to still display a
menu's name but not retain the actual link) :-
$data=preg_replace("'<A HREF[^>]*?>'si", "",$data);
$data=str_replace("</A>","",$data);
Presto!
Alex.