Jump to content

yoob

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

yoob's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Alright. I studied the php.net manuals, and everything you said, and i came up with this little thing: [code]        $number = count($plik)-10;         for ($i=count($plik); $i>=$number ; $i--){         echo $plik[$i];         } [/code] And it works ^______^ Thanks a lot.
  2. I know but is there a way i could somehow merge this reverse iterating with the 'for ($i=0;$i<10; $i++){'? I mean, where should i put it? Seems all those $i's collide with each other
  3. Hmm, another problem. See, i have this small piece of line reverse code, making the bottom lines of the file show up at the top. I've put it together myself so it may not be perfect: [code]<?         $file=fopen("news/news.txt", "r");         flock($file,1);         $plik= array();         while (!feof($file)){                 $plik[] = fgets($file,5000);         }         flock($file,3);         fclose($file);         for ($i=count($plik); $i>= 0; $i--){         echo $plik[$i];         } ?>[/code] I try to merge it with the code you guys provided, but i dont think im skilled enough to understand all this. Could you help me out?
  4. Thanks, all of these work like a charm, will keep them saved.
  5. Hey guys Can you tell me how to make a script that would open the file, and print out only the first 10 lines from it? First 10 from the top.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.