Current location: Hot Scripts Forums » Programming Languages » PHP » dynamically add arrays to an array


dynamically add arrays to an array

Reply
  #1 (permalink)  
Old 04-29-06, 03:37 PM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
dynamically add arrays to an array

i'm trying to do this:
PHP Code:

$list = array('a1''b1''c1', );

$list2 = array('a2''b2''c2', );



$pist = array($list$list2);

foreach (
$pist as $klister){
    
    echo 
$klister[0].', ';
    } 

but i'm trying to do it with dynamically created arrays, like this:
PHP Code:



foreach (bla bla bla){

// code goes here that populates each array
$search_Array .= array('url' => $search_CleanItemUrl'item' => $search_ItemLong'artist' => $search_ArtistLong'album' => $search_AlbumLong'row' => $row).', '
how do i add each $search_Array to a single array, and then do a foreach as in the example above?


please, someone help me out here, i'm stuck...
Reply With Quote
  #2 (permalink)  
Old 04-29-06, 05:01 PM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
ok, after a day of swearing over this i finally found the solution...


PHP Code:



$search_ArrayData 
= array('url' => $search_CleanItemUrl'item' => $search_ItemLong'artist' => $search_ArtistLong'album' => $search_AlbumLong'row' => $row).', ';  

$search_Array[] = $search_ArrayData 
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add up a range of items in an array Nuts&Bolts General HotScripts Site Discussion 0 11-23-05 02:54 PM
Needing a script to add up a range in an array Nuts&Bolts Script Requests 1 11-22-05 02:48 PM
Compare arrays drophit PHP 0 07-09-05 03:33 PM
Serializing a set of arrays dannyallen PHP 2 10-11-04 03:04 AM
linking to iframe not working :( j0d JavaScript 5 01-19-04 08:14 PM


All times are GMT -5. The time now is 07:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.