php-general | 2001072
Date: 07/16/01
- Next message: garman: "[PHP] submitting free-form text to a database"
- Previous message: Adrian Teasdale: "Re: [PHP] sending to large mailing list"
- Maybe in reply to: sgibbs <email protected>: "[PHP] how to strip just the <img> tag from html file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
$printerFriendlyContent = eregi_replace('<img[^>]*>', '', $htmlContent);
You can also use
$printerFriendlyContent = eregi_replace('src="[^"]*"',
'src="images/spacer.gif"', $htmlContent);
to preserve formatting (spacer.gif = 1x1 px transparent)
> -----Original Message-----
> From: sgibbs <email protected> [mailto:sgibbs <email protected>]
> Sent: 16 iulie 2001 14:53
> To: php-general <email protected>
> Subject: [PHP] how to strip just the <img> tag from html file?
>
>
> I've created a "printer-friendly" version of a page
> (PHP/MySQL) and want to
> have just the <img> tags automatically removed. I thought about using
> strip_tags() but I'm not able to predict what html tags to
> include as the
> exceptions so that they would not be removed too. How can I
> do this? Thank
> you!
>
> - Shawna
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail:
> php-list-admin <email protected>
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: garman: "[PHP] submitting free-form text to a database"
- Previous message: Adrian Teasdale: "Re: [PHP] sending to large mailing list"
- Maybe in reply to: sgibbs <email protected>: "[PHP] how to strip just the <img> tag from html file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

