RE: [PHP] Printing Array Key Value Pair
| From: | Maxim Maletsky | Date: | Thu, 31 Aug 2000 07:58:23 +0000 |
| Subject: | RE: [PHP] Printing Array Key Value Pair | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14540@lists.php.net to get a copy of this message | ||
Try this
>>print "Class = $curr_cat['catclass'];
I think you got confused with syntaxes there...
-----Original Message-----
From: David Hall [mailto:mp3site@hotmail.com]
Sent: Thursday, August 31, 2000 4:46 PM
To: php-general@lists.php.net
Subject: [PHP] Printing Array Key Value Pair
Say for instance I have an array called $curr_cat with a key "catclass".
So then $currcat = array("catclass" => "somevalue")
How do I print the value this array holds in it?
When I try:
>>print "Class = $curr_cat["catclass"]"
I get a syntax errror. Presumably because of some sort of quote issue. I'm
running PHP3.
Thanks for the newbie help!
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net