I want to compare an array variable and Normal variable using if condition in PHP.. I have an Array VAriable as .$AllowedEnquiryType[$i] and a variabe as $TIntType how to check these to are equal.
My coding is
for($i=1;$i<=$length;$i++)
{
if($AllowedEnquiryType[$i]==$TIntType)
{
return true;
}
else
{
return false;
}
}
returnfrom the method/function/file right at the first iteration. Also usually arrays begin with0(not1) and the last element is$length -1and not$length.