Page 1 of 1

PHP Hash Table

Posted: Wed Feb 11, 2009 1:01 am
by rcua
Hi,

I am trying to insert, update and display items that a user have collected. I heard that, using hash table would be more efficient, is it true? What is hash table? How to do it? I am using php5 and mysql. Any tutorial with simple code would be great.

Thanks. :D

Re: PHP Hash Table

Posted: Fri Feb 13, 2009 6:51 am
by susrisha
hash table as such doesnt exist in php. Its got another name=>associative arrays. Have a look at the arrays manual http://in2.php.net/manual/en/book.array.php for more details.

Its basically like this. In an array you will have

Code: Select all

 
$array[1]='something';
$array[2]='somethingelse';
 
On an associative array you will have

Code: Select all

 
$phone_number['victor']=98272634;
$phone_number['sam']=5652332;
 
These are called key value pairs.. Thats a basic information.. More can be got on the link