Jump to content

match text and use in if statement


beaviss

Recommended Posts

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 tried

if ($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 ?

Regards
Anton.
Link to comment
https://forums.phpfreaks.com/topic/12508-match-text-and-use-in-if-statement/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.