note 14202 rejected and deleted from language.types.array.php by zak
| From: | zak@php.net | Date: | Sun, 22 Jul 2001 07:34:30 +0000 |
| Subject: | note 14202 rejected and deleted from language.types.array.php by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15652@lists.php.net to get a copy of this message | ||
Why following code does not works?
What is up with warnings?
<head><title>84</title></head>
<body>
<?php
$user = array (
'name' => 'tom' ,
'age'=> 30,
'gender' => 'male');
print_r($user);
print $user[name]."n<br>";
print $user[age]."n<br>";
print $user[gender]."n<br>";
?>
</body>
</html>
/*out put
Array ( [name] => tom [age] => 30 [gender] => male )
Warning: Use of undefined constant name - assumed 'name' in C:localphp84.php on line 10
tom
Warning: Use of undefined constant age - assumed 'age' in C:localphp84.php on line 11
30
Warning: Use of undefined constant gender - assumed 'gender' in C:localphp84.php on line
12
male
*/