Old 09-05-2007, 16:28   #1 (permalink)
chris_bcn
Goodbye little old lady
 
chris_bcn's Avatar
 
Join Date: Jun 2005
Location: Geordie in SF
Posts: 339
Send a message via MSN to chris_bcn
strip_tags removing EVERYTHING

which in a way is good. However... I'm using Simplepie to parse rss feeds from 6 different blogs. I just want the <p> and <a> elements. I want to remove all the images.

This is what I have - I thought the syntax was right, but it removes all the text. all the images, everything

Code:
<?php strip_tags($item->get_description(),'<p> <a>') ?>

How do I get this to work?

[edit] oops - helps to echo it! move along nothing to see here
  Reply With Quote
Old 09-05-2007, 16:40   #2 (permalink)
encryptocat
Registered User
 
Join Date: Apr 2007
Location: California
Posts: 5
you are missing a semicolon ( ; ) on the end of the statement.
  Reply With Quote
Old 10-05-2007, 17:17   #3 (permalink)
gk
geek
 
gk's Avatar
 
Join Date: Oct 2006
Location: *.everywhere
Posts: 204
Send a message via ICQ to gk Send a message via AIM to gk Send a message via MSN to gk Send a message via Yahoo to gk
and you need to echo/print the results
PHP Code:
<?php
     
echo strip_tags($item->get_description(),'<p> <a>') ;
?>

Edit: Oh I see you saw that too, I just missed that part of your post :P
__________________
Quote:
"Why reinvent the wheel"? Simply because it's not round enough and I don't like the treads.
  Reply With Quote
Old 31-05-2007, 06:39   #4 (permalink)
LazyMoon
Registered
 
LazyMoon's Avatar
 
Join Date: Sep 2006
Location: Adelaide, Australia
Posts: 12
It could be the space between the <p> and the <a> that causes it to strip everything, but I haven't tested it.

Alternatively, you can try:
Code:
echo preg_replace('!<img ?.*/?>!iU','',$string);
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8