Web Analytics Made Easy -
StatCounter Read Last 100 Entries from a Data File - CodingForum


No announcement yet.

Read Last 100 Entries from a Data File

  • Filter
  • Time
  • Show
Clear All
new posts

  • Read Last 100 Entries from a Data File

    Could somebody please show me how to always read only the last 100 entries from a text data file like this?



  • #2
    There might be other ways but this works
    PHP Code:
    $file_handle fopen("http://bybyron.uni.cc/server_data/server_data_July_2011.dat""r");
    while (!
    feof($file_handle) ) {
    $parts[$ax] = fgets($file_handle);
    $ax>100) {
    for ( 
    $counter $ax-100$counter <= $ax$counter += 1) {
    } else {
    for ( 
    $counter 1$counter <= $ax$counter += 1) {
    If you can't stand behind your troops, feel free to stand in front of them
    Semper Fidelis


    • #3
      This will display the last $numRecords records of the file.

      PHP Code:

      $numRecords 5//number of records from eof to read
      if (count($lines) >= $numRecords) {
          for (
      $i count($lines) - $numRecords$i count($lines); $i++) {
      $lines[$i] . '<br />';
      } else {
          for (
      $i 0$i count($lines); $i++) {
      $lines[$i] . '<br />';
      Last edited by webdev1958; Aug 28, 2011, 12:15 AM.


      • #4
        Thanks guys! Both solutions work great!


        • #5
          The main difference between the 2 solutions is that the file() function does all the opening, reading and closing of the data file.


          • #6
            Originally posted by webdev1958 View Post
            The main difference between the 2 solutions is that the file() function does all the opening, reading and closing of the data file.
            Ok, thank you!


            • #7
              I agree, Webdev1958 showed me something new to save me time.
              If you can't stand behind your troops, feel free to stand in front of them
              Semper Fidelis


              • #8
                Unfortunately as your filesize increases, the probability of exhausting your memory will also increase. There is no real solution to this, but IMO to combat it you would need to use an fopen technique with a line skip and count back in a 100 entry buffer. What a pain.
                If you can actually create this data file though, you could create a random access file instead and use seek. Since you only have the date and a server load, you can do that with a single integer and a single float and parse out the data to display as you see fit. The pro to this is that you now know each record is 64 bits in size, and you can use fseek in combination with 100x the 8bytes, and count backwards.

                So, if I converted these into an strtotime and added a float for the load, I'd end up with a dat file like this (no header, so you may want to consider adding that in).
                N  ˆ@;?
                N×£[email protected][[
                N  ¸@|w
                Nأُ[email protected]ث½
                N33£@,[email protected]_.NR¸[email protected][<NىQ€@‍fNR¸–@£tN…ë‘@ج‍Nأُ[email protected]غ¬NىQ¨@×N…“@هNحج\@;NHل¢@LNل[email protected]{9NHل[email protected]?cN
                ×[email protected]تqNHل:@ذN\[email protected]ـ?Nأُ[email protected]
                ¸[email protected]%ئ[email protected]+شN…[email protected]ًN{ژ@ض`N®[email protected]§Nأُ[email protected],µN\?؛@<أN×£ط@KرN  <A`كNq=&AjيNHل*A{ûNلz,A?	Nq=AœN  ب@¬%N¤pإ@¼3N?آص@جAN¸¥@غONلz„@ى]N?™±@ükN¤pإ@zN?آ[email protected]ˆNىQب@+–Nِ( A;¤N
                ×AL²NىQà@\?Nلz¼@kخNحجش@{ـN{ض@‹êN{A›ّNR¸¶@«N®·@¼N\?Aج"N®cAـ0N¸aAë>N   AûLN…A[Nِ(AiN¸إ@+wN)\—@;…N  €@L“N¸[email protected][،N®G‰@p¯Nأُè@|½Nq=¢@?ثNHل²@?ظNحج[email protected]¬çN{¾@¼ُN…ë¹@ثN  AغNلzAىNأُ8Aْ-Nأُ[email protected]<Nِ(AJN®ك@+XN?™é@<fN{>AKtN=
                ×#A|‍NىQ(A‹¬NffBAœ؛N?آُ@«بNأًُ@»ضN®AخنNىQAغٍNq=JAë NىQXAüN)\ANHلٍ@+NأُA+9N®Gù@;GNأُ(AKUN  üA\cN  œAkqN…ë³A{N=
                [email protected]‹?N…ë[email protected]››N
                ×@¬©N®Gل?¼·N®ç?ثإNى[email protected]غسN×£[email protected]ëلNل[email protected]üïNffژ@‏Nq=ANq=²@,N33ƒ@=(Nلzج@L6N…£@[D[email protected]N  ط@‚`N…£@?nNحجج@œ|N  [email protected]¬?N=
                '@¼?N?آ[email protected]ج¦N33#@ـ´Nأُ[email protected]ىآNأُ[email protected]üذN\[email protected]كNأُ(@يN…ë[email protected],ûN®@<	N
                ׋@LNR¸‍@\%N®Gل@l3Nِ([email protected]|AN  ¨@›ON3sWC?Nfff?!خN…ëر?.ـN)\¯??êNحجج?LّNq=ê?\NR¸@kNq=ê?|"N®Gء??0Nل[email protected]œ>N…ë±?«LN×£ذ?»ZN  ??جhN¸¥?ـvN¸إ?ى„NىQ¸?ü’N=
                ·?،N×£ً?¯Nأُè?+½N?™[email protected]>ثN
                ×[email protected]ظN¤p]@[çN\[email protected]ُNأُ@|Nq=ê?ŒNأُ@œNq=ê?«-NىQ@¼;Nلzش?جINHل
                @يeNىQ¸?‎sN  à?‚N…ëر??N
                ×م?,‍N\?آ?;¬NىQط?L؛N×£ذ?]بN…ëر?kضNq=ت?|نNffئ?ŒٍNffو?› N?آُ?¬Nff@»NR¸@ج*NR¸[email protected]ـ8N  @@ىFN¸[email protected]üTN¸@c[email protected]qN…ë‰@-NR¸@<?N33#@M›Nل[email protected]\©N…‹@l·N=
                @}إN)\@ŒسNِ(ـ?œلN…ëٌ?¬ïN®[email protected]¼‎N®G¹@جN33³@غNHل[email protected]ى'N)\§@û5Nى[email protected]DNHلê@RNلzü@-`NR¸NA<nNq=A`?N{¦@n?Nلz´@|¦N?™™@Œ´N…ƒ@œآNR¸[email protected]«ذN…ë[email protected]½قN?آ[email protected]جىN…ƒ@ـْ[email protected]ىN…{@üNHل[email protected]%Nأُ[email protected]3Nِ(¤@,AN?آ*@<ON®[email protected]]kNR¸[email protected]Nِ(œ@?•N)\؟@œ£N{^@¬±NىQˆ@¼؟Nأُ€@جحNلzœ@غغNحج”@ىéN…ë[email protected]‏÷N¸…@[email protected]N¤p•@,"N×£[email protected]<0NلzŒ@M>N®[email protected]]L[email protected]N¸…@|hN×£[email protected]ŒvNq=‚@œ„N…[email protected]*’N?آ[email protected]¼*N…‹@ح®N¤p…@ـ¼N…ë[email protected]ëتN  [email protected]üطN  [email protected]
                [email protected],N?™‘@>N®¯@LN=
                [email protected]]-NىQ°@n;N¤pه@{IN{و@œeN?آ•@¬sNحج\@¼?N…ë[email protected]ج?[email protected]ـ?N?آ[email protected]ى«N{>@ü¹N=
                بNأُ[email protected]ضN=
                '@,نN…ë[email protected]=ٍN¸µ@K N=
                ·@]NR¸AmN®#A|*N?آ½@Œ8Nحجü@œFN  *@¬TNلz„@»bNلz”@جpN…[email protected]ف~NR¸‍@ىŒN¸[email protected]ü?[email protected]©N?آµ@·N…[@/إNِ(\@<سN…ë©@LلN=
                [email protected]]ïNأُ€@m‎N¤p]@|N?آ@ŒNِ(@œ'[email protected]¬5N¤p½@¼CN{و@جQNِ(ô@غ_Nأُ¨@ëmNR¸@ü{N
                ×[email protected]?Nأُ[email protected]?N{[email protected],¦NR¸¶@<´Nq=آ@LآNR¸¶@]ذN®·@sقN×£*@ىN)\[email protected]?ْN¸[email protected]? N{>@¬ N?آ[email protected]¼$ N¤p}@ث2 N{[email protected]ـ@ N{>@يN N{ژ@
                k N\[email protected]y N=
                '@,‡ N)\[email protected]<• NىQ@L£ N®@]± Nلzô?l؟ N?™)@|ح N…ë[email protected]Œغ N=
                [email protected]?é N?آ%@¬÷ Nِ([email protected]¼!NR¸[email protected]ج!N33“@ـ!!N  [email protected]ى/!Nأُˆ@ü=!N®[email protected][email protected]Z!N  ذ@,h!NىQ*@<v!NR¸^@N„!NR¸[email protected]]’!NلzŒ@l*!NHلْ?|®!N…ë?Œ¼!Nلzش?œت!Nffو?«ط!NHل
                @¼و!N®@جô!Nأُè?ـ"N\?@ë"N®@û"NR¸ق?-"N®G،@;"NىQ@,I"[email protected]<W"N×£@@Le"[email protected]_s"N=
                [email protected]?"Nى[email protected]}?"N  ¬B‹?"N¤p•@¬¹"N{@¼ا"N?™[email protected]جص"N=
                '@ـم"N®[email protected]ىٌ"N33@ü?"[email protected]
                #N×£€@#N?™‘@+*#N{A<8#Nff‏@LF#NR¸NA\T#N¸QAlb#N33A|p#NR¸6AŒ~#N®çA¦Œ#Nِ(¤@°?#Nى[email protected]؟¨#N\[email protected]خ¶#Nحج[email protected]àؤ#N…أ@èز#NHل؛@‎#N\?ع@-$N)\؟@<$N…م@M'$Nq=آ@]5$N\[email protected]$Nلzن@|Q$N¤p‎@?_$N?آه@*m$NحجA±{$N)\÷@¼‰$N  Aج—$NR¸Aف¥$N?™	Aى³$N®د@ûء$NR¸A
                ذ$N×£0Aق$Nحجج@+ى$Nِ(œ@<ْ$N×£[email protected]%N¤p½@^%N®ا@m$%N)\§@|2%N33‹@[email protected]%Nحجü@œN%N\?A¬\%N…A¼j%Nq=ê@جx%N…ëٌ@ف†%NىQAي”%N¸‎@ü¢%N®·@±%Nحجü@؟%N®[email protected]+ح%N®ï@=غ%N\?؛@Lé%N\[email protected]]÷%Nلz¬@l&N\?¢@|&N\?ْ@Œ!&N=
                Aœ/&N?™¹@¬=&NىQط@¼K&N{AدY&N…ëAفg&N?آه@ىu&N?آي@‎ƒ&N×£A’&N33س@*&N¸A,®&NR¸ض@B¼&N¤pARت&N…ث@cط&N=
                ï@¬'N¤p	A»,'N…ëظ@ح:'N?™ر@فH'N®؟@ىV'Nلzن@ûd'N=
                ·@s'NHلâ@?'N=
                [email protected]*?'N\?‚@½
                (N{[email protected]ج(N{خ@ـ)(N\[email protected]ë7(N33ƒ@ûE(N×£`@T(N?™ظ?b(NHل[email protected]+p(N?™ر@<~(N¸§ALŒ(N)\A^?(N
                ¯@5)NىQˆ@C)N?™[email protected],Q)N?™[email protected]<_)N=
                —@Lm)N\?‚@]{)NHل[email protected]‰)N…[@|—)[email protected]Œ¥)N33‹@‍³)N?™‘@«ء)N¸•@¼د)[email protected]حف)NR¸îAفë)N¸Aىù)N?™[email protected]ü*N
                ·@,2*N  ب@<@*Nq=ê@KN*Nلzü@\\*N  ب@lj*N  ّ@|x*NR¸¦@Œ†*N®G¹@›”*N=
                [email protected]«¢*NHل¢@¼°*N  [email protected]ج¾*Nى[email protected]فج*N)\[email protected]ëع*N=
                [email protected]ûè*N®[email protected]÷*N  à@+N)\[email protected]++NR¸[email protected]<!+Nِ(,@K/+N?آ[email protected]^=+N?™jBlK+N\?²@{Y+N¸…@¬ƒ+NHلع@»‘+N{ِ@ث?+NأُAـ*+Nِ(ؤ@ى»+N…'Aüة+N33Aط+Nلzـ@و+N33ث@-ô+N{ِ@<,N{ِ@\,Nأُ*@l,,Nحجن@|:,N…ëAAŒH,Nحج?A›V,NR¸ئ@±d,N33غ@¾r,N\?
                ¹,NىQBا,N×£$A,ص,N?آ	A<م,N33ALٌ,N…ë
                -NحجA-NىQAŒ)-N)\÷@£7-N?™¹@¬E-N®AآS-N¸Aجa-N{Aكo-Nأُ°@ى}-Nحج¤@‎‹-N®Gة@?-Nq=¢@¨-N?™‰@,¶-N…A<ؤ-N
                ×ALز-NR¸î@bà-N   A|ü-NHلAŒ
                .Nأُ,A{.N=
                ×[email protected]¬/NHل’@¾/N…ë[email protected]ج#/NىQˆ@ـ1/N?™
                A\/Nq=:Aj/Nff"A.x/N¸[email protected]<†/N®[email protected]”/N×£°@\¢/NىQà@l°/Nq=¢@|¾/N=
                ا@Œج/NR¸‍@œع/NHل[email protected]¬è/N?آ¥@¾ِ/N{¶@ج0N×£€@ف0N)\[email protected]ى 0N…ë‰@ü.0Nأُ[email protected]=0N?آف@K0N¤[email protected],Y0N?آي@<g0N\?FAMu0NأُA\ƒ0N…ëAl‘0N{ِ@|?0Nحج0AŒ*0Nِ(جA1Nلz@,1N…ë[email protected],:1N?™‰@<H1N{[email protected]حج<@\d1N®[email protected]¤[email protected]{€1NR¸[email protected]Œژ1Nffو?œœ1NR¸@¬?1N{‍@½¸1N  ¸@ـش1NHلْ@يâ1Nأُ[email protected]üً1NHل[email protected]
                2NىQ@,2N)\@<)2N\[email protected]×£[email protected]_E2N®[email protected]¸[email protected]|a2N
                ×[email protected]*‹2N?™[email protected]½™2Nأُ@ج§2Nq=²@فµ2N®[email protected]ىأ2Nل[email protected]‎ر2N¸[email protected]à2Nأُ[email protected]î2NحجA,ü2Nلzن@<
                3N{[email protected]3N®G@d&3Nل[email protected]×£ً?|B3N33@ŒP3NىQ@¬l3Nff†@¼z3N?™ر@جˆ3N  `@ق–3N=
                [email protected]ى¤3N¤p¥@ü²3N
                ׃@ء3Nِ(|@د3Nل[email protected]ف3N{^@<ë3Nل[email protected]ù3N¸*@]4Nى[email protected]4N=
                [email protected]|#4N=
                @حi4N®Gل?ـw4N®ç?ى…4N?آ@ü“4N{@¢4N?™[email protected]°4N\[email protected],¾4N)\[email protected]<ج4N®[email protected]ع4NR¸[email protected]è4N¤p@lِ4N
                ×[email protected]{5N¤p…@Œ5NHل’@œ 5N®G‰@¬.5N…ƒ@¼<5N)\[email protected]جJ5N×£[email protected]ـX5N{^@ëf5N…;@üt5N…ë@ƒ5N{[email protected]‘5NR¸[email protected],?5N{[email protected][»5NHل¢@]ة5N¤[email protected]×5N{[email protected]|ه5N=
                And read with:
                PHP Code:


                $iToRecord 100;
                $iRecordSize 8;


                if (
                $fh fopen($sPath'r'))
                fseek($fh, -($iToRecord $iRecordSize), SEEK_END);
                    while (
                $sRecord fread($fh$iRecordSize))
                $aUnpacked unpack('idate/fload'$sRecord); 
                $iTime $aUnpacked['date'];
                $fLoad $aUnpacked['load'];
                printf('<li class="%s">%s | Server Load:*%0.2f</li>' PHP_EOLdate('D'$iTime), date('D jS M, h:i:s a'$iTime), $fLoad);
                Results in:
                <ol><li class="Wed">Wed 27th Jul, 08:30:04 am | Server Load:*4.96</li>
                <li class="Wed">Wed 27th Jul, 09:30:04 am | Server Load:*5.34</li>
                <li class="Wed">Wed 27th Jul, 10:30:04 am | Server Load:*5.18</li>
                <li class="Wed">Wed 27th Jul, 11:30:06 am | Server Load:*5.69</li>
                <li class="Wed">Wed 27th Jul, 12:30:04 pm | Server Load:*4.02</li>
                <li class="Wed">Wed 27th Jul, 01:30:05 pm | Server Load:*3.74</li>
                <li class="Wed">Wed 27th Jul, 02:30:04 pm | Server Load:*4.31</li>
                <li class="Wed">Wed 27th Jul, 03:30:04 pm | Server Load:*4.53</li>
                <li class="Wed">Wed 27th Jul, 04:30:04 pm | Server Load:*6.93</li>
                <li class="Wed">Wed 27th Jul, 05:30:04 pm | Server Load:*3.71</li>
                <li class="Wed">Wed 27th Jul, 06:30:04 pm | Server Load:*7.43</li>
                <li class="Wed">Wed 27th Jul, 07:30:04 pm | Server Load:*12.41</li>
                <li class="Wed">Wed 27th Jul, 08:30:05 pm | Server Load:*8.31</li>
                <li class="Wed">Wed 27th Jul, 09:30:04 pm | Server Load:*9.87</li>
                <li class="Wed">Wed 27th Jul, 10:30:04 pm | Server Load:*7.69</li>
                <li class="Wed">Wed 27th Jul, 11:30:04 pm | Server Load:*11.05</li>
                <li class="Thu">Thu 28th Jul, 12:30:04 am | Server Load:*25.52</li>
                <li class="Thu">Thu 28th Jul, 08:30:04 am | Server Load:*2.07</li>
                <li class="Thu">Thu 28th Jul, 09:30:05 am | Server Load:*3.78</li>
                <li class="Thu">Thu 28th Jul, 10:30:04 am | Server Load:*4.30</li>
                <li class="Thu">Thu 28th Jul, 11:30:04 am | Server Load:*3.97</li>
                <li class="Thu">Thu 28th Jul, 12:30:03 pm | Server Load:*2.95</li>
                <li class="Thu">Thu 28th Jul, 01:30:04 pm | Server Load:*2.77</li>
                <li class="Thu">Thu 28th Jul, 02:30:04 pm | Server Load:*2.71</li>
                <li class="Thu">Thu 28th Jul, 03:30:03 pm | Server Load:*2.73</li>
                <li class="Thu">Thu 28th Jul, 04:30:04 pm | Server Load:*1.80</li>
                <li class="Thu">Thu 28th Jul, 05:30:04 pm | Server Load:*2.23</li>
                <li class="Thu">Thu 28th Jul, 06:30:04 pm | Server Load:*4.94</li>
                <li class="Thu">Thu 28th Jul, 07:30:05 pm | Server Load:*5.75</li>
                <li class="Thu">Thu 28th Jul, 09:30:04 pm | Server Load:*7.84</li>
                <li class="Thu">Thu 28th Jul, 10:30:05 pm | Server Load:*3.39</li>
                <li class="Thu">Thu 28th Jul, 11:30:04 pm | Server Load:*3.92</li>
                <li class="Fri">Fri 29th Jul, 12:30:05 am | Server Load:*4.59</li>
                <li class="Fri">Fri 29th Jul, 01:30:05 am | Server Load:*2.38</li>
                <li class="Fri">Fri 29th Jul, 02:30:04 am | Server Load:*2.49</li>
                <li class="Fri">Fri 29th Jul, 03:30:04 am | Server Load:*3.79</li>
                <li class="Fri">Fri 29th Jul, 04:30:05 am | Server Load:*4.52</li>
                <li class="Fri">Fri 29th Jul, 05:30:07 am | Server Load:*4.49</li>
                <li class="Fri">Fri 29th Jul, 06:30:04 am | Server Load:*3.08</li>
                <li class="Fri">Fri 29th Jul, 07:30:04 am | Server Load:*2.81</li>
                <li class="Fri">Fri 29th Jul, 10:30:05 am | Server Load:*2.90</li>
                <li class="Fri">Fri 29th Jul, 11:30:05 am | Server Load:*2.39</li>
                <li class="Fri">Fri 29th Jul, 12:30:04 pm | Server Load:*5.57</li>
                <li class="Fri">Fri 29th Jul, 01:30:05 pm | Server Load:*4.04</li>
                <li class="Fri">Fri 29th Jul, 02:30:04 pm | Server Load:*3.07</li>
                <li class="Fri">Fri 29th Jul, 03:30:05 pm | Server Load:*3.08</li>
                <li class="Fri">Fri 29th Jul, 04:30:12 pm | Server Load:*3.39</li>
                <li class="Fri">Fri 29th Jul, 05:30:07 pm | Server Load:*8.80</li>
                <li class="Fri">Fri 29th Jul, 06:30:04 pm | Server Load:*7.14</li>
                <li class="Fri">Fri 29th Jul, 07:30:04 pm | Server Load:*2.72</li>
                <li class="Fri">Fri 29th Jul, 08:30:04 pm | Server Load:*2.02</li>
                <li class="Fri">Fri 29th Jul, 09:30:12 pm | Server Load:*2.82</li>
                <li class="Fri">Fri 29th Jul, 10:30:08 pm | Server Load:*1.88</li>
                <li class="Fri">Fri 29th Jul, 11:30:04 pm | Server Load:*2.05</li>
                <li class="Sat">Sat 30th Jul, 12:30:04 am | Server Load:*2.38</li>
                <li class="Sat">Sat 30th Jul, 02:30:04 am | Server Load:*4.20</li>
                <li class="Sat">Sat 30th Jul, 03:30:04 am | Server Load:*6.55</li>
                <li class="Sat">Sat 30th Jul, 04:30:04 am | Server Load:*3.50</li>
                <li class="Sat">Sat 30th Jul, 05:30:06 am | Server Load:*3.11</li>
                <li class="Sat">Sat 30th Jul, 06:30:04 am | Server Load:*5.17</li>
                <li class="Sat">Sat 30th Jul, 07:30:04 am | Server Load:*4.12</li>
                <li class="Sat">Sat 30th Jul, 08:30:04 am | Server Load:*3.94</li>
                <li class="Sat">Sat 30th Jul, 09:30:05 am | Server Load:*3.32</li>
                <li class="Sat">Sat 30th Jul, 10:30:05 am | Server Load:*3.47</li>
                <li class="Sat">Sat 30th Jul, 11:30:04 am | Server Load:*3.07</li>
                <li class="Sat">Sat 30th Jul, 12:30:04 pm | Server Load:*5.41</li>
                <li class="Sat">Sat 30th Jul, 01:30:05 pm | Server Load:*2.88</li>
                <li class="Sat">Sat 30th Jul, 02:30:04 pm | Server Load:*3.11</li>
                <li class="Sat">Sat 30th Jul, 03:30:04 pm | Server Load:*2.61</li>
                <li class="Sat">Sat 30th Jul, 04:30:07 pm | Server Load:*1.99</li>
                <li class="Sat">Sat 30th Jul, 05:30:06 pm | Server Load:*2.48</li>
                <li class="Sat">Sat 30th Jul, 06:30:04 pm | Server Load:*2.59</li>
                <li class="Sat">Sat 30th Jul, 07:30:05 pm | Server Load:*2.11</li>
                <li class="Sat">Sat 30th Jul, 08:30:05 pm | Server Load:*1.76</li>
                <li class="Sat">Sat 30th Jul, 09:30:04 pm | Server Load:*1.81</li>
                <li class="Sat">Sat 30th Jul, 10:30:04 pm | Server Load:*2.34</li>
                <li class="Sat">Sat 30th Jul, 11:30:04 pm | Server Load:*2.22</li>
                <li class="Sun">Sun 31st Jul, 12:30:04 am | Server Load:*3.40</li>
                <li class="Sun">Sun 31st Jul, 01:30:31 am | Server Load:*3.04</li>
                <li class="Sun">Sun 31st Jul, 02:30:04 am | Server Load:*3.49</li>
                <li class="Sun">Sun 31st Jul, 03:30:04 am | Server Load:*3.52</li>
                <li class="Sun">Sun 31st Jul, 04:30:04 am | Server Load:*3.23</li>
                <li class="Sun">Sun 31st Jul, 05:30:10 am | Server Load:*2.46</li>
                <li class="Sun">Sun 31st Jul, 06:30:04 am | Server Load:*3.56</li>
                <li class="Sun">Sun 31st Jul, 07:30:03 am | Server Load:*4.17</li>
                <li class="Sun">Sun 31st Jul, 08:30:04 am | Server Load:*4.59</li>
                <li class="Sun">Sun 31st Jul, 09:30:04 am | Server Load:*4.29</li>
                <li class="Sun">Sun 31st Jul, 10:30:04 am | Server Load:*4.11</li>
                <li class="Sun">Sun 31st Jul, 11:30:04 am | Server Load:*3.49</li>
                <li class="Sun">Sun 31st Jul, 12:30:04 pm | Server Load:*4.77</li>
                <li class="Sun">Sun 31st Jul, 01:30:04 pm | Server Load:*3.47</li>
                <li class="Sun">Sun 31st Jul, 02:30:03 pm | Server Load:*2.93</li>
                <li class="Sun">Sun 31st Jul, 03:30:04 pm | Server Load:*2.28</li>
                <li class="Sun">Sun 31st Jul, 04:30:04 pm | Server Load:*3.22</li>
                <li class="Sun">Sun 31st Jul, 05:30:05 pm | Server Load:*3.23</li>
                <li class="Sun">Sun 31st Jul, 06:30:04 pm | Server Load:*3.97</li>
                <li class="Sun">Sun 31st Jul, 08:30:19 pm | Server Load:*5.09</li>
                <li class="Sun">Sun 31st Jul, 09:30:05 pm | Server Load:*4.92</li>
                <li class="Sun">Sun 31st Jul, 10:30:07 pm | Server Load:*3.97</li>
                <li class="Sun">Sun 31st Jul, 11:30:04 pm | Server Load:*11.19</li>
                Nice. I don't know whether it was the c&p or if it was the forums here, but there is no linefeeds between these.

                One other benefit is that the packed file is 6kb versus the original @ 49kb.

                I love random access files.
                PHP Code:
                header('HTTP/1.1 420 Enhance Your Calm'); 
                Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


                • #9
                  PHP Code:
                  $file './newseek.dat';

                  $lines file$fileFILE_IGNORE_NEW_LINES );
                  $lines array_slice$lines, -100 );