I've noticed this, too. There are at least two things you can do to 
make them work...

print("Some text {$myhash['mykey']}<BR>\n")

or

print("Some text ".$myhash['mykey']."<BR>\n")

jim

>Hey there,
>
>sortta simple question... Is it just me or can't you access hashes within
>strings?
>This works...
>print("Some text $myarray[0]<BR>\n");
>This doesn't
>print("Some text $myhash['mykey']<BR>\n");
>
>i'm asking in relation to databases (not that that matters). If i fetch a row
>from the database I can use the $array[0], [1], etc in the print statements
>if i use mysql_fetch_array (oh sorry, u people call it associative arrays
>instead of hashes, my mistake) i can't access $array['fieldname'] from within
>a print statement but I CAN do
>$DBID = $resultarray['idfieldname'];
>and then use $DBID.....
>
>regards
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to