Jump to content


returning only values of a chunked array

  • Please log in to reply
1 reply to this topic

#1 brainstem

  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 September 2006 - 07:31 PM

I can't quite figure this one out, need some help widdit.

pulling all content from a file via file_get_content('massive.txt');
and chunking it all into 2 word arrays
problem is when I go to foreach ($arr as $value) echo $value
it just spits out a rediculous amout of 'Array' echos.
tried a for loop as well with no luck.

how can I take a huge chunked array and strip out thier contents, but in the proper sequence.
Massive Array (roughly 1700 internal unassigned (per chunk) arrays with 2 words each)

main arr
    arr 0-apple 1-apple2
    arr 0-orange 1-orange2
    arr 0-pear 1-pear2

echo as

Apple Apple2
Orange Orange2
Pear Pear2

Thanks in advance!

#2 sasa

  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 29 September 2006 - 10:08 PM

foreach ($arr as $value) echo implode(' ',$value);

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users