[PHP] Newbie continued..wrong datatype

2002-07-11 Thread Rw
This is a continue from this morning (thanks so much for the responses).. yielding a data type mismatch: $CheckArr = array("Periodic", "Sale", "Return"); IF (SUBSTR($approvalcode,0,1) == "Y" && in_array($CheckArr, $type)) { PRINT "$approvalcode"; PRINT " "; PRINT "$type"; } Th

Re: [PHP] Newbie continued..wrong datatype

2002-07-11 Thread Martin Clifford
As far as I'm aware, the first argument to the in_array() function is the needle (what you're searching for) and the second is the array to be searched through (the haystack). So if $type represents what you're searching for, then it would be written as: in_array($type, $CheckArr); If you sup

Re: [PHP] Newbie continued..wrong datatype

2002-07-11 Thread Rw
That did it! Thanks! - Original Message - From: "Martin Clifford" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, July 11, 2002 1:32 PM Subject: Re: [PHP] Newbie continued..wrong datatype As far as I'm aware, t

Re: [PHP] Newbie continued..wrong datatype

2002-07-11 Thread Chris Hewitt
The manual says the second parameter needs to be an array. I assume it is not, but you have not shown us how $type is assigned so we cannot tell. HTH Chris Rw wrote: >This is a continue from this morning (thanks so much for the responses).. >yielding a data type mismatch: > > $CheckArr = arra