Jump to content

IF statement isn't matching?


MySQL_Narb

Recommended Posts

FULL source: http://paste2.org/p/2847150

 

foreach($results as $result){
//skill name
$skill = $result->firstChild->nodeValue;
$info = $result->getElementsByTagName('td');

//skill info
$rank = $info->item(1)->nodeValue;
$level = $info->item(2)->nodeValue;
$xp = $info->item(3)->nodeValue;

if($skill != 'Skill'){
echo '<b>'. $skill .'</b> <b>'. $xp .'</b> <hr>';
if($skill == 'Overall' && $xp == '-'){
$exists = false;
break;
}

//SKILL:RANK:LEVEL:XP
$skill_info[] = $skill .':'. $rank .':'. $level .':'. $xp;
}
}

 

In the above code, why doesn't the following if statement work:

 


if($skill == 'Overall' && $xp == '-'){
$exists = false;
break;
}

 

As you can see, I echoed out the variables and both are what they should be. I even checked the page source to see if there were any special surprises, and there wasn't. Any ideas?

 

PICTURE OF ECHOED RESULTS: http://puu.sh/20E4q

Link to comment
https://forums.phpfreaks.com/topic/274317-if-statement-isnt-matching/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.