uknowho008 Posted May 25, 2007 Share Posted May 25, 2007 this should be a simple answer but i cant figure out what to use to strip text for use in rss. i keep getting errors because of things like "–" thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/52984-strip-text-for-rss/ Share on other sites More sharing options...
chigley Posted May 25, 2007 Share Posted May 25, 2007 <?php $str = "abcd-efghi-jklmno-p"; $str = str_replace("-", "", $str); // abcdefghijklmnop ?> And to remove a series of characters: <?php $remove = array("-", "+", "<", ">"); $string = "-a+b<c>d"; foreach($remove as $search) { $string = str_replace($search, "", $string); } echo $string; // abcd ?> Quote Link to comment https://forums.phpfreaks.com/topic/52984-strip-text-for-rss/#findComment-261707 Share on other sites More sharing options...
uknowho008 Posted May 25, 2007 Author Share Posted May 25, 2007 i was hoping to find a function that just cut out everything that cant be used in rss. but i guess that will work. thanks Quote Link to comment https://forums.phpfreaks.com/topic/52984-strip-text-for-rss/#findComment-261709 Share on other sites More sharing options...
chigley Posted May 25, 2007 Share Posted May 25, 2007 Why do you need to cut things out in the first place? What are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/52984-strip-text-for-rss/#findComment-261710 Share on other sites More sharing options...
uknowho008 Posted May 25, 2007 Author Share Posted May 25, 2007 im just trying to make an rss out of data in my database. but i get errors from having some things in the description. Quote Link to comment https://forums.phpfreaks.com/topic/52984-strip-text-for-rss/#findComment-261721 Share on other sites More sharing options...
per1os Posted May 25, 2007 Share Posted May 25, 2007 Create your own function to strip those items. PHP does not know what RSS standards are, nor should they. I am sure if you google around someone already created a similiar function. Best of luck. Quote Link to comment https://forums.phpfreaks.com/topic/52984-strip-text-for-rss/#findComment-261742 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.