I've killed the script with die($condition), and it echos "kid's-health" which by all accounts should match. I've also tried changing the case to be double-quotes, but with no success. I feel like I'm missing something simple, but I'd like some help if its not too much trouble.

jmraker

I would add test code to see what if ($condition == "kid's-health") does

Code:

// If it returns false the ' letter is not in the string
var_dump(strpos($condition, "'"))

if($condition == "kid's-health")
die('ok');

My first thought was that the ' letter might have been entered as a unicode or that another letter that MS-Word uses or some letter being uppercase. If the ' letter checks out my next guess would be to switch in or out of unicode in firefox to see if the letters in the string change

Your code is OK but PHP for some reason sometimes don't do what we want. Try to change single quotes in double quotes. BTW I think case/switch function is much better then if function if you have more then three if/else queries.

changing to all double quotes is the first thing I tried, no dice. Also, the if statement is test code... as should be apparent by the die()'s.

kacsababa

The apostrophe must be a different character in the input then the condition, something like jmraker said.
Echo $subsection out to the browser and compare, maybe they are just lookalike, for example ’ and ' are looks totally the same with some fonts.

Aredon

the die i posted earlier echos both to the browser, the result was copy pasted into a quote.

EDIT: got it figured out after viewing source, one of the characters had been converted to an HTML entity for some reason.