Print out array keys only

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi, there are lots of examples that show you how to print array values
given a key. Do you know how to print keys for a given array.


$myArray = array('a'=>1, 'b'=>2, 'c'=>3, 'd'=>4);

How do you print 'a', 'b', 'c','d'  only without using any loops?

Thanks in advance for all your help

Re: Print out array keys only

undbund kirjoitti:
Quoted text here. Click to load it

echo implode(', ', array_keys($myArray));


"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

Site Timeline