why doesn't $books[$val][display] show the value
| From: | Peter J. Schoenster | Date: | Thu, 09 May 2002 22:26:22 +0000 |
| Subject: | why doesn't $books[$val][display] show the value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96878@lists.php.net to get a copy of this message | ||
Hi,
I've got an array like the following:
$books = array(
"1572316217" => array(
category => 'tech',
display => 'Steve McConnell\'s Software Project Survival Guide',
href =>
'http://www.amazon.com/exec/obidos/ASIN/1572316217/readbrazil07-20',
title => 'Steve McConnell\'s Software Project Survival Guide',
width => '71',
height => '90',
src => '/images/1572316217.01.TZZZZZZZ.jpg',
vspace => '3',
alt => 'Steve McConnell\'s Software Project Survival Guide',
hspace => '3',
comments => "",
),
$books = $AfiliateLinkBuilder->get_books();
srand ((float) microtime() * 10000000);
$rand_keys = array_rand ($books, 2);
while (list ($key, $val) = each ($rand_keys)) {
$display = $books[$val][display];
Why do I have to do this:
$display = $books[$val][display];
rather than
$html.= " Yaddda yadda $books[$val][display]";
$books[$val][display] in the double quotes only shows display. I
thought that within double quotes I don't use double quotes for
elements ... ? What's the rule on this. I could do the above in Perl.
Thanks,
Peter
-- http://www.readbrazil.com/
Answering Your Questions About Brazil