NYCPHP Meetup

NYPHP.org

[nycphp-talk] need help understanding parsing difference

Keith Richardson keith.richardson at thompsonhealth.com
Tue Nov 4 14:02:49 EST 2003


I believe that 2 dimensional arrays need to break out of the echo statement
to print the string. By the looks of it, you are printing $PRODUCTS[$here],
which is an array, which is why it just prints Array, and php thinks [$here]
is printing the [ and ] characters, with the variable $here inside. I like
to break out of all my strings for arrays just to be on the safe side of
things.

Keith Richardson
Thompson Health Information Systems
keith.richardson at thompsonhealth.com

-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of Michael Southwell
Sent: Tuesday, November 04, 2003 1:59 PM
To: talk at lists.nyphp.org
Subject: [nycphp-talk] need help understanding parsing difference


When $PRODUCTS[$here]["v1b"]="holster"
and $j="v1b"
echo "<a href=\"path/$PRODUCTS[$here][$j]\"... evaluates to path/Array[v1b]
which is meaningless
but echo "<a href=\"path/".$PRODUCTS[$here][$j]."\"... evaluates to
path/holster which is correct (or to be more precise, what I wanted).
Why this difference?  Thanks in advance.

Michael G. Southwell =================================
DNEBA Enterprises
81 South Road
Bloomingdale, NJ 07403-1419
973/492-7873 (voice and fax)
southwell at dneba.com
http://www.dneba.com
======================================================

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list