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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.