|
How to use associative array in php?
|
|
04-29-2012, 11:57 AM
(This post was last modified: 04-29-2012 05:24 PM by bex_spin0.)
Post: #2
|
|||
|
|||
RE: How to use associative array in php?
(04-25-2012 03:15 AM)phpdeveloperindia Wrote: How to use associative array in php? An associative array also stores data in the same way but gives you more flexibility by letting you assign any name you want to your keys instead of using keys 0, 1, 2, 3, 4, and so on. This is helpful when you want to assign a certain value to your key. For example, you want an array which display the height of school children in cm, your associative array function will look like this: <?php $height=array('Billy'=>90, 'Sam'=>95, 'Susie'=>92, Tamara=>89); ?> To retrieve the value for each key you just have to type in: echo $height ('Billy'); or echo $height ('Sam'); and so on. Hope this helps. I will code for food. |
|||
|
« Next Oldest | Next Newest »
|
| Messages In This Thread |
|
How to use associative array in php? - phpdeveloperindia - 04-25-2012, 03:15 AM
RE: How to use associative array in php? - bex_spin0 - 04-29-2012 11:57 AM
RE: How to use associative array in php? - cheochi - 05-31-2012, 06:30 PM
RE: How to use associative array in php? - semaphore.v - 04-08-2013, 04:38 AM
RE: How to use associative array in php? - flecheradams - 05-09-2013, 08:41 AM
RE: How to use associative array in php? - hosting - 05-10-2013, 02:28 AM
|
User(s) browsing this thread: 1 Guest(s)




