PHP If Else – String Comparison Question
-
Hey guys on my wordpress blog I am trying to compare the following
if ($category[0]->cat_name == “television” )
in wordpress the $category[] is the array of categories a post has, and cat-name i just the actual name of that category.
If I echo $category[0]->cat_name it is television
but I can’t get this to flag as true for the if statement, something is wrong and it keeps doing the ELSE part.
Anyone know what is wrong here?
thank you alot for any help
Travis
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘PHP If Else – String Comparison Question’ is closed to new replies.