Both things that you describe are arrays. The only difference between the two is that you explicitly set the keys for the second, and as such they are known as associative arrays . I don’t know where you got the hash terminology (Perl?), But that’s not what they refer to as PHP.
So, for example, if you have to do this:
$foo = array(1,2,3,4,5); print_r($foo);
The conclusion will be:
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 )
As you can see, the keys for accessing the individual values you entered were created for you, but nonetheless exist. So this array is essentially associative. The other "type" of the array is exactly the same, except that you explicitly say "I want to access this value using this key" instead of automatic numeric indices (although the key you provided may also be numeric).
$bar = array('uno' => 'one', 'dos' => 'two'); print_r($bar);
Output:
Array ( [uno] => one [dos] => two )
As you might expect, executing print $bar['one'] outputs uno , and executing $foo[0] from the first example will result in output 1 .
As for functions, PHP functions in most cases use one of these "types" of the array and do what you want, but there are differences that you need to know about, since some functions will make funky to your indexes, and some not. It is usually best to read the documentation before using the array function, as it will notice which result will depend on the keys of the array.
For more information, you should read the manual .