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. Quote 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 == Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.