Created
          March 2, 2011 10:24 
        
      - 
      
- 
        Save langsharpe/850741 to your computer and use it in GitHub Desktop. 
    PHP example of an array with a hole in it
  
        
  
    
      This file contains hidden or 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'; | |
| foreach($a as $value) { | |
| print $value . "\n"; | |
| } | |
| ?> | 
  
    
      This file contains hidden or 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 | |
| two | |
| four | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment