TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   IF statements with XML files Magpie Parser (http://www.talkphp.com/general/3422-if-statements-xml-files-magpie-parser.html)

buildakicker 10-02-2008 09:22 PM

IF statements with XML files Magpie Parser
 
Hello all,

I have a XML file that I have set up with a <status> item. I have been trying to use an IF statement to grab the Items that only have <fostatus>YES</fostatus>. Why can't I just do this:

PHP Code:

            echo '<ul class="newsclass">';
        foreach (
$items as $item ){ 
if(!
$item['fostatus'] = 'NO'){        
        echo 
'<li><strong><a href="'.$item['link'].'">'.$item['title'].'</a></strong><br /><span class="readmorehilite">Forest Order #: ' .$item['ordernumber']. '</span> - <span class="readmore">In Effect? </span><span class="readmorefostatus">' .$item['fostatus']. '</span><br />' .$item['description']. '</li>';
            }
}
            echo 
'</ul>'

I am using Magpie to parse.

Salathe 10-02-2008 10:23 PM

Try one of the following:
  • if ($item['fostatus'] != 'NO') {
  • if ($item['fostatus'] == 'YES') {


All times are GMT. The time now is 12:31 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0