On Mar 13, 2013, at 5:02 PM, David Harkness wrote:
> isset() will return false for an array key 'foo' mapped to a null value
> whereas array_key_exists() will return true. The latter asks "Is this key in
> the array?" whereas isset() adds "and is its value not null?" While isset()
> is every-so-
2013/3/14 David Harkness
>
> On Wed, Mar 13, 2013 at 5:10 PM, Sebastian Krebs wrote:
>
>> Because 'null' is the representation of "nothing" array_key_exists() and
>> isset() can be treated as semantically equivalent.
>
>
> As I said, these functions return different results for null values. It
>
On Wed, Mar 13, 2013 at 5:10 PM, Sebastian Krebs wrote:
> Because 'null' is the representation of "nothing" array_key_exists() and
> isset() can be treated as semantically equivalent.
As I said, these functions return different results for null values. It
won't matter for Angela since she isn't
2013/3/14 David Harkness
> On Wed, Mar 13, 2013 at 4:44 PM, Angela Barone
> wrote:
>
> > I ran across if(array_key_exists) and it seems to work. How does that
> > differ from if(isset($states[$state]))?
>
>
> Hi Angela,
>
> isset() will return false for an array key 'foo' mapped to a null value
On Wed, Mar 13, 2013 at 4:44 PM, Angela Barone
wrote:
> I ran across if(array_key_exists) and it seems to work. How does that
> differ from if(isset($states[$state]))?
Hi Angela,
isset() will return false for an array key 'foo' mapped to a null value
whereas array_key_exists() will return true
On Mar 13, 2013, at 4:24 PM, Matijn Woudt wrote:
> That wouldn't work, in_array checks the values, and your states are in the
> keys. Use:
> if(isset($states[$state]))
Hi Matijn,
Before I received your email, I ran across if(array_key_exists) and it
seems to work. How does that differ
On Thu, Mar 14, 2013 at 12:18 AM, Angela Barone wrote:
> On Mar 13, 2013, at 9:07 AM, Jim Giner wrote:
> > Why not just check if the $state exists as a key of the array $states
> before doing this?
>
> Jim,
>
> Are you thinking about the in_array function?
>
> Angela
That wouldn't work,
On Mar 13, 2013, at 9:07 AM, Jim Giner wrote:
> Why not just check if the $state exists as a key of the array $states before
> doing this?
Jim,
Are you thinking about the in_array function?
Angela
On Wed, Mar 13, 2013 at 5:07 PM, Jim Giner wrote:
> On 3/12/2013 9:04 PM, Angela Barone wrote:
>
>> On Mar 12, 2013, at 5:16 PM, David Robley wrote:
>>
>>> Presumably there is a fixed list of State - those are US states? -
>>>
>>
>> so why not provide a drop down list of the possible choices?
>>>
On 3/12/2013 9:04 PM, Angela Barone wrote:
On Mar 12, 2013, at 5:16 PM, David Robley wrote:
Presumably there is a fixed list of State - those are US states? -
so why not provide a drop down list of the possible choices?
There is, but the problem must have been that if someone didn't
On Mar 12, 2013, at 5:16 PM, David Robley wrote:
> Presumably there is a fixed list of State - those are US states? -
> so why not provide a drop down list of the possible choices?
There is, but the problem must have been that if someone didn't select
a State, $state was blank. I've sin
Angela Barone wrote:
> I think I figured it out.
>
> $states = array(
> 'AL' => array( '350','351','352','353', ),
> 'AK' => array( '995','996','997','998','999', ),
> 'AZ' => array( '850','851','852','853','854', ),
> 'WI' => array( '530','531','532', ),
> 'WY' => array( '82
I think I figured it out.
array( '350','351','352','353', ),
'AK' => array( '995','996','997','998','999', ),
'AZ' => array( '850','851','852','853','854', ),
'WI' => array( '530','531','532', ),
'WY' => array( '820','821','822','823','824', ),
);
$zip = 35261;
$state =
$states = array(
'AL' => array( '350','351','352','353', ),
'AK' => array( '995','996','997','998','999', ),
'AZ' => array( '850','851','852','853','854', ),
...
'WI' => array( '530','531','532', ),
'WY' => array( '820','821','822','823','824', ),
);
?>
Seei
On Mar 12, 2013, at 2:26 PM, Marco Behnke wrote:
> what is in $states?
> Looks like $states[$state] is not an array.
Here's a sample:
array( '350','351','352','353', ),
'AK' => array( '995','996','997','998','999', ),
'AZ' => array( '850','851','852','853','854', ),
...
Am 12.03.13 20:45, schrieb Angela Barone:
> I've been getting the following error for awhile now, but I can't
> figure out why it's happening:
>
> Invalid argument supplied for foreach() in ... sample.php on line 377
>
> Here's that portion of code:
>
> include("states_zipcodes.php");
16 matches
Mail list logo