RE: [PHP] Real Problem: Accessing Array In A Class
| From: | Taylor, Stewart | Date: | Mon, 09 Apr 2001 14:34:09 +0000 |
| Subject: | RE: [PHP] Real Problem: Accessing Array In A Class | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-47791@lists.php.net to get a copy of this message | ||
Try,
print "blah blah blah {$this->arrayname['value']} blah";
-Stewart
-----Original Message-----
From: DELAP, SCOTT F (SBCSI) [mailto:sd3982@sbc.com]
Sent: 09 April 2001 15:28
To: php-general@lists.php.net
Subject: [PHP] Real Problem: Accessing Array In A Class
I've been trying to figure this out for a day or so now. Someone needs to
do a concise tutorial with arrays, references, etc. with PHP. I've got a
class that has a member variable that is an array. When I try to access it
in a function like this:
print "blah blah blah $this->arrayname['value'] blah";
$this->arrayname evaluates to an array object and ['value'] comes out as a
string. If I assign it to a variable first like so:
$arraytemp = $this->arrayname;
print "blah blah blah $arraytemp['value'] blah";
it works fine. However, I know there should be a way to reference it
directly. Any suggestions on what I have do to as far as brackets, etc. to
force php to evaluate it they way I want?
Scott Delap
SBC Services, Inc.
sd3982@sbc.com
314-235-6216
--
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