Skip to content

Instantly share code, notes, and snippets.

@sohelrana820
Created August 4, 2013 19:05
Show Gist options
  • Save sohelrana820/6151481 to your computer and use it in GitHub Desktop.
Save sohelrana820/6151481 to your computer and use it in GitHub Desktop.
<?php
$MyArray = array('Name'=>'Rana','ID'=>'092-15-820','Batch'=>'23');
// If you want to echo the name just write "echo $MyArray['Name']";
echo $MyArray['Name'];
//Another way
$MyArray2 = array('Rana','092-15-820','23');
// If you want to echo the name just write "echo $MyArray2[0]";
echo $MyArray2[0];
//The only different between two array is indexing. First one is Indexing with (Name,ID,Batch)
//And the second one is not indexing, if we are not indexed the array the we need to access with default(0,1,2,.....)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment