Jump to content

[SOLVED] Having Trouble Validating Array()


phpQuestioner

Recommended Posts

I am trying to check my array with a if else condition, but it does not seem to be working; what do I need to do too make this work - would I explode "asm"?

 

<?php

$asm = array("1","2","3","4","5");

if ($cat != "$asm") {
echo "Not An Option";
}

?>

 

The above code will echo out "Not An Option" even if $cat is equal to 1, 2, 3, 4, or 5.

Link to comment
https://forums.phpfreaks.com/topic/76717-solved-having-trouble-validating-array/
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.