etrader Posted February 10, 2011 Share Posted February 10, 2011 I have a foreach loop as foreach ($xml->channel->item as $value){ $title = $value->title; $text = $value->text; echo "$title <br /> $text"; } I want to skip any entry in which the title contains a character like ":" Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 10, 2011 Share Posted February 10, 2011 if (stristr($title, ':')) { continue; // go to next element } Quote Link to comment Share on other sites More sharing options...
etrader Posted February 10, 2011 Author Share Posted February 10, 2011 Perfect solution! Thanks! Quote Link to comment 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.