SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Jun 30, 2007, 02:44 #1
- Join Date
- Mar 2007
- Posts
- 77
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
in_array problem can any1 help me please...
Ok I looked on google and I have been up all night I am very close to working out my problem. I am having an issue with this in_array function. Here is my line of code:
Line 35: if in_array($ShipState, $Zone1States))
Here is my error:
Wrong datatype for second argument in call to in_array in c:\apache\htdocs\trials\payment.php on line 35
can anyone tell me why I can not check if the variable from a form is in the array?
here is more of the code:
$ShipState = $_POST[ShippingState];
// check zone 1 states
$Zone1States == explode(",", $options['Zone1']);
//check ship address to zone 1 states
if (in_array($ShipState, $Zone1States))<---line 35
{
$ZoneShipping = $_POST[ShippingPrice];
echo 'User\'s City Found in Zone1';
}
-
Jun 30, 2007, 03:01 #2
- Join Date
- Jan 2007
- Location
- Belgium
- Posts
- 591
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You're comparing $Zone1States and explode(",", $options['Zone1']).
Use one =
PHP Code:$Zone1States = explode(",", $options['Zone1']);
FOR SALE: 1 set of morals, never used, will sell cheap
-
Jun 30, 2007, 03:05 #3
- Join Date
- Mar 2007
- Posts
- 77
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Bookmarks