ID:               15468
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: Linux d2 2.2.20-ow1-procmax-smp
 PHP Version:      4.1.1
 New Comment:

Simple because 'ap' is NOT a key in the first case. See yourself with
var_dump($pole); how the array looks like.


Previous Comments:
------------------------------------------------------------------------

[2002-02-09 13:20:25] [EMAIL PROTECTED]

Hello,

I'm trying function array_key_exists in this sample script, but doesn't
work:

<?
$a="ap";
$pole = array(1 => "ap", "aa", "dd");
if (array_key_exists($a, $pole)):
    echo "The element is in the array";
endif;
?>

but when using:

$pole = array("ap" => 1, "aa" => 2, "dd" => 3);

it's working. Can somebody look at this problem?

Thanks,
Pavel Hrabal

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15468&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to