Created
March 2, 2011 11:17
-
-
Save langsharpe/850787 to your computer and use it in GitHub Desktop.
Undefined array index in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a[2] = 'two'; | |
$a[4] = 'four'; | |
print $a[5]; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lang@virtualbox1:~/arrays$ php array.php | |
PHP Notice: Undefined offset: 5 in /home/lang/arrays/array.php on line 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment