I'm passing the variable $words
(a string containing the words "someText") to an if-statement. I'm testing whether the variable contains these words, and want to base any further logic of off that.
Weird thing is that the test returns false
every time, even though the variable contains the words "someText"!
if ($words == "someText") {
return "True " . $words;
} else {
return "False " . $words;
}
The output value is always:
False someText
So the test equates to false
, but the variable contains the words "someText"! Why is that?
I should add that I'm using return
instead of echo
because my cms requires that, and I'm passing the value Older to the $words variable before running the code above.