beaviss Posted June 21, 2006 Share Posted June 21, 2006 Hi,I need to construct an else elseif statement from plain text I have in an array.If I know that $filearray[12] could contain the words "available" or "unavailable"How do I test for this?I have triedif ($filearray[12]=="available"){echo 'something' ;}else{echo 'something else' ;}but it hasnt proved reliable, as when I know the text is unavailable, it says it is available in the if statement.What am I doing wrong - how does one effectively test for a match ?RegardsAnton. Link to comment https://forums.phpfreaks.com/topic/12508-match-text-and-use-in-if-statement/ Share on other sites More sharing options...
.josh Posted June 21, 2006 Share Posted June 21, 2006 that if statement should work. if it's "unreliable" it's because your data is wrong. but if you wanna go balls to the wall you could use === instead of == Link to comment https://forums.phpfreaks.com/topic/12508-match-text-and-use-in-if-statement/#findComment-47910 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.