brainstem Posted September 29, 2006 Share Posted September 29, 2006 All I am trying to do is get all the text from a file and display them like this:your notgood enoughat phpyet tofigure thiscrap outbrainstem growlThis is what I have, I can not for the life of my figure out a way around array_values$massive = str_word_count(file_get_contents('massive.txt', 1));$massivechunk = array_chunk($massive, 2, FALSE);print_r(array_values($massivechunk));for ($i = 0, $c = 10; $i < $c; $i++) {foreach (($massivechunk[$i]) as $domassive) { echo $domassive; echo "<br>";}} Link to comment Share on other sites More sharing options...
Barand Posted September 29, 2006 Share Posted September 29, 2006 Assuming "massive.txt" contains[quote]your not good enough at php yet to figure this crap out brainstem growl[/quote]then[code]<?php$massive = explode(' ', file_get_contents('massive.txt', 1));$massivechunk = array_chunk($massive, 2);foreach ($massivechunk as $chunk){ echo join(' ',$chunk).'<br/>';}?>[/code] Link to comment Share on other sites More sharing options...
Barand Posted September 29, 2006 Share Posted September 29, 2006 Read forum guidelines and DO NOTdouble post Link to comment Share on other sites More sharing options...
Recommended Posts