Re: accessing array contents

From: Date: Sat, 24 Aug 2002 05:39:48 +0000
Subject: Re: accessing array contents
Groups: php.general 
Request: Send a blank email to php-general+get-113899@lists.php.net to get a copy of this message
Why, can't you just print $match_list[i][imageurl]? Like: echo $match_list[$i]['imageurl']; - E
I'm having trouble figuring out how to access specific fields in an associative array. I have an array called match_list with elements of imagename, album and imgurl. $match_list[$i]['imagename']=$this_match[$file_match]; $match_list[$i]['album']=$this_match[$album_match]; $match_list[$i]['imageurl']= $this_match[$album_match] . "/" . $this_match[$file_match]; I can read the contents sequentially with this coding: foreach ($match_list as $key => $value) {
     foreach ($value as $tkey => $tvalue)
     {
         echo "$tkey = $tvalue<br>";
    }
} Therefore, I know I've got values stored. How do I access just the "imgurl" for each match_list[$i] element? What I want to do is take the first nine match_list[$i] values and display just the imgurl for ($i = 1; $i <= 10; $i++) {
    print  ???  what?
} Thanks for the help. John Hughes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ キャリアアップを目指すあなたのナビゲーター MSN 就職・転職 http://career.msn.co.jp/

« previous php.general (#113899) next »