Skip to content

Instantly share code, notes, and snippets.

@langsharpe
Created March 2, 2011 10:24
Show Gist options
  • Save langsharpe/850741 to your computer and use it in GitHub Desktop.
Save langsharpe/850741 to your computer and use it in GitHub Desktop.
PHP example of an array with a hole in it
<?php
$a[2] = 'two';
$a[4] = 'four';
foreach($a as $value) {
print $value . "\n";
}
?>
lang@virtualbox1:~/arrays$ php array.php
two
four
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment