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

Announcement

Collapse
No announcement yet.

Read Last 100 Entries from a Data File

Collapse
X
 
  • 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?



    Thanks!

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

    Comment


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

      PHP Code:
      <?php

      $lines 
      file('test.dat');
      $numRecords 5//number of records from eof to read
      if (count($lines) >= $numRecords) {
          for (
      $i count($lines) - $numRecords$i count($lines); $i++) {
              echo 
      $lines[$i] . '<br />';
          }
      } else {
          for (
      $i 0$i count($lines); $i++) {
              echo 
      $lines[$i] . '<br />';
          }
      }
      ?>
      Last edited by webdev1958; Aug 27, 2011, 11:15 PM.

      Comment


      • #4
        Thanks guys! Both solutions work great!

        Comment


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

          Comment


          • #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!

            Comment


            • #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

              Comment


              • #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).
                Code:
                #
                N  ˆ@;?
                N33أ@LM
                N×£?@[[
                N\?آ@oi
                N  ¸@|w
                NR¸ژ@?…
                N)\—@›“
                Nأُ?@ث½
                Nحج„@ـث
                N)\‡@ِ
                N33£@,NffV@_.NR¸n@[<NىQ€@‍fNR¸–@£tN…ë‘@ج‍Nأُ?@غ¬NىQ¨@×N…“@هNحج\@;NHل¢@LNلzT@{9NHلz@?cN
                ×C@تqNHل:@ذN\?B@ـ?NأُH@
                ¸N33C@%ئNfff@+شN…k@LًN{ژ@ض`N®G?@§Nأُ?@,µ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?آ?@ˆ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¸5@[،N®G‰@p¯Nأُè@|½Nq=¢@?ثNHل²@?ظNحجl@¬çN{¾@¼ُN…ë¹@ثN  AغNلzAىNأُ8Aْ-Nأُ?@<Nِ(AJN®ك@+XN?™é@<fN{>AKtN=
                KAZ‚N¸MAk?N
                ×#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=
                ?@‹?N…ë!@››N
                ×@¬©N®Gل?¼·N®ç?ثإNىQX@غسN×£P@ëلNلzT@üïNffژ@‏Nq=ANq=²@,N33ƒ@=(Nلzج@L6N…£@[DNffv@lRN  ط@‚`N…£@?nNحجج@œ|N  ?@¬?N=
                '@¼?N?آE@ج¦N33#@ـ´NأُX@ىآNأُH@üذN\?2@كNأُ(@يN…ë1@,ûN®@<	N
                ׋@LNR¸‍@\%N®Gل@l3Nِ(L@|AN  ¨@›ON3sWC?Nfff?!خN…ëر?.ـN)\¯??êNحجج?LّNq=ê?\NR¸@kNq=ê?|"N®Gء??0Nلz$@œ>N…ë±?«LN×£ذ?»ZN  ??جhN¸¥?ـvN¸إ?ى„NىQ¸?ü’N=
                ·?،N×£ً?¯Nأُè?+½N?™I@>ثN
                ×C@LظN¤p]@[çN\?R@nُNأُ@|Nq=ê?ŒNأُ@œNq=ê?«-NىQ@¼;Nلzش?جINHل
                @فWN=
                @يeNىQ¸?‎sN  à?‚N…ëر??N
                ×م?,‍N\?آ?;¬NىQط?L؛N×£ذ?]بN…ëر?kضNq=ت?|نNffئ?ŒٍNffو?› N?آُ?¬Nff@»NR¸@ج*NR¸~@ـ8N  @@ىFN¸5@üTN¸@cNq=Z@qN…ë‰@-NR¸@<?N33#@M›NلzD@\©N…‹@l·N=
                @}إN)\@ŒسNِ(ـ?œلN…ëٌ?¬ïN®Ga@¼‎N®G¹@جN33³@غNHل?@ى'N)\§@û5NىQ?@DNHلê@RNلzü@-`NR¸NA<nNq=A`?N{¦@n?Nلz´@|¦N?™™@Œ´N…ƒ@œآNR¸n@«ذN…ëA@½قN?آE@جىN…ƒ@ـْNffF@ىN…{@üNHلZ@%Nأُ8@3Nِ(¤@,AN?آ*@<ON®Ga@]kNR¸n@myNِ(œ@?•N)\؟@œ£N{^@¬±NىQˆ@¼؟Nأُ€@جحNلzœ@غغNحج”@ىéN…ë?@‏÷N¸…@Nq=?@N¤p•@,"N×£p@<0NلzŒ@M>N®w@]LNq=Z@lZN¸…@|hN×£P@ŒvNq=‚@œ„N…+@*’N?آE@¼*N…‹@ح®N¤p…@ـ¼N…ëq@ëتN  ?@üطN  ?@
                çN
                ×م@ُN=
                g@,N?™‘@>N®¯@LN=
                ?@]-NىQ°@n;N¤pه@{IN{و@œeN?آ•@¬sNحج\@¼?N…ë1@ج?NffF@ـ?N?آU@ى«N{>@ü¹N=
                '@
                بNأُH@ضN=
                '@,نN…ë!@=ٍN¸µ@K N=
                ·@]NR¸AmN®#A|*N?آ½@Œ8Nحجü@œFN  *@¬TNلz„@»bNلz”@جpN…k@ف~NR¸‍@ىŒN¸?@ü?NffV@©N?آµ@·N…[@/إNِ(\@<سN…ë©@LلN=
                ?@]ïNأُ€@m‎N¤p]@|N?آ@ŒNِ(@œ'Nq=J@¬5N¤p½@¼CN{و@جQNِ(ô@غ_Nأُ¨@ëmNR¸@ü{N
                ×C@?Nأُ?@?N{~@,¦NR¸¶@<´Nq=آ@LآNR¸¶@]ذN®·@sقN×£*@ىN)\?@?ْN¸u@? N{>@¬ N?آ?@¼$ N¤p}@ث2 N{~@ـ@ N{>@يN N{ژ@
                k N\?b@y N=
                '@,‡ N)\?@<• NىQ@L£ N®@]± Nلzô?l؟ N?™)@|ح N…ëA@Œغ N=
                w@?é N?آ%@¬÷ Nِ(l@¼!NR¸~@ج!N33“@ـ!!N  ?@ى/!Nأُˆ@ü=!N®G1@L!Nq=Z@Z!N  ذ@,h!NىQ*@<v!NR¸^@N„!NR¸.@]’!NلzŒ@l*!NHلْ?|®!N…ë?Œ¼!Nلzش?œت!Nffو?«ط!NHل
                @¼و!N®@جô!Nأُè?ـ"N\?@ë"N®@û"NR¸ق?-"N®G،@;"NىQ@,I"N33S@<W"N×£@@Le"N33C@_s"N=
                g@m?"NىQ8@}?"N  ¬B‹?"N¤p•@¬¹"N{@¼ا"N?™9@جص"N=
                '@ـم"N®G!@ىٌ"N33@ü?"NffV@
                #N×£€@#N?™‘@+*#N{A<8#Nff‏@LF#NR¸NA\T#N¸QAlb#N33A|p#NR¸6AŒ~#N®çA¦Œ#Nِ(¤@°?#NىQ8@؟¨#N\?B@خ¶#NحجL@àؤ#N…أ@èز#NHل؛@‎#N\?ع@-$N)\؟@<$N…م@M'$Nq=آ@]5$N\??@mC$Nلzن@|Q$N¤p‎@?_$N?آه@*m$NحجA±{$N)\÷@¼‰$N  Aج—$NR¸Aف¥$N?™	Aى³$N®د@ûء$NR¸A
                ذ$N×£0Aق$Nحجج@+ى$Nِ(œ@<ْ$N×£?@L%N¤p½@^%N®ا@m$%N)\§@|2%N33‹@?@%Nحجü@œN%N\?A¬\%N…A¼j%Nq=ê@جx%N…ëٌ@ف†%NىQAي”%N¸‎@ü¢%N®·@±%Nحجü@؟%N®?@+ح%N®ï@=غ%N\?؛@Lé%N\??@]÷%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=
                ك@pو&N¤pإ@ô&NHلت@?'N=
                ؟@£'N=
                ï@¬'N¤p	A»,'N…ëظ@ح:'N?™ر@فH'N®؟@ىV'Nلzن@ûd'N=
                ·@s'NHلâ@?'N=
                د@,?'N{–@<?'N¤p?AL«'NR¸ض@^¹'N®G™@mا'Nffِ@|ص'N…ëة@‹م'Nff‍@?ٌ'N=
                ?@*?'N\?‚@½
                (N{~@ج(N{خ@ـ)(N\??@ë7(N33ƒ@ûE(N×£`@T(N?™ظ?b(NHلj@+p(N?™ر@<~(N¸§ALŒ(N)\A^?(N
                ×KAl¨(N?آ1A|¶(N?™A?ؤ(N…ëmAœز(N?™A*à(NHل‚@¼î(N…ث@جü(N33ث@ـ
                )N)\ك@ë)Nff®@ü&)N=
                ¯@5)NىQˆ@C)N?™y@,Q)N?™?@<_)N=
                —@Lm)N\?‚@]{)NHلj@m‰)N…[@|—)N33s@Œ¥)N33‹@‍³)N?™‘@«ء)N¸•@¼د)Nq=Z@حف)NR¸îAفë)N¸Aىù)N?™Y@ü*N
                ׃@*Nلzؤ@$*N=
                ·@,2*N  ب@<@*Nq=ê@KN*Nلzü@\\*N  ب@lj*N  ّ@|x*NR¸¦@Œ†*N®G¹@›”*N=
                W@«¢*NHل¢@¼°*N  ?@ج¾*NىQH@فج*N)\?@ëع*N=
                W@ûè*N®G@÷*N  à@+N)\_@++NR¸N@<!+Nِ(,@K/+N?آE@^=+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\?
                Aج€,Nأُ¨@ـژ,N…›@ىœ,Nِ(´@‎?,N®G#B
                ¹,NىQBا,N×£$A,ص,N?آ	A<م,N33ALٌ,N…ë
                A\?,N…Al
                -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=
                د@‰.NHلJA-—.NأُA<¥.N¸AAM³.N…ëA\ء.N…Amد.NىQA|ف.N
                ×أ@Œë.Nأُط@œù.N
                ×s@¬/NHل’@¾/N…ë?@ج#/NىQˆ@ـ1/N?™
                Aى?/Nِ(ô@üM/N=
                A\/Nq=:Aj/Nff"A.x/N¸u@<†/N®Gq@L”/N×£°@\¢/NىQà@l°/Nq=¢@|¾/N=
                ا@Œج/NR¸‍@œع/NHل?@¬è/N?آ¥@¾ِ/N{¶@ج0N×£€@ف0N)\o@ى 0N…ë‰@ü.0Nأُ?@=0N?آف@K0N¤pm@,Y0N?آي@<g0N\?FAMu0NأُA\ƒ0N…ëAl‘0N{ِ@|?0Nحج0AŒ*0Nِ(جA1Nلz@,1N…ëq@,:1N?™‰@<H1N{~@KV1Nحج<@\d1N®G1@lr1N¤p-@{€1NR¸.@Œژ1Nffو?œœ1NR¸@¬?1N{‍@½¸1N  ¸@ـش1NHلْ@يâ1NأُX@üً1NHلz@
                ?1NHل’@
                2NىQ@,2N)\@<)2N\?r@M72N×£?@_E2N®?@lS2N¸E@|a2N
                ×3@*‹2N?™9@½™2Nأُ@ج§2Nq=²@فµ2N®G?@ىأ2NلzD@‎ر2N¸E@à2NأُX@î2NحجA,ü2Nلzن@<
                3N{.@L3N®G@d&3Nلz4@p43N×£ً?|B3N33@ŒP3NىQ@¬l3Nff†@¼z3N?™ر@جˆ3N  `@ق–3N=
                G@ى¤3N¤p¥@ü²3N
                ׃@ء3Nِ(|@د3NلzT@-ف3N{^@<ë3NلzD@Lù3N¸*@]4NىQ8@l4N=
                G@|#4N=
                '@?14NR¸‏?‍?4NR¸@¬M4N?آ%@½[4N=
                @حi4N®Gل?ـw4N®ç?ى…4N?آ@ü“4N{@¢4N?™Y@7°4N\?B@,¾4N)\_@<ج4N®Ga@Lع4NR¸N@bè4N¤p@lِ4N
                ×c@{5N¤p…@Œ5NHل’@œ 5N®G‰@¬.5N…ƒ@¼<5N)\_@جJ5N×£?@ـX5N{^@ëf5N…;@üt5N…ë@ƒ5N{N@‘5NR¸N@,?5N{~@[»5NHل¢@]ة5N¤p?@o×5N{~@|ه5N=
                3A
                And read with:
                PHP Code:
                <?php

                $sPath 
                './newseek.dat';

                $iToRecord 100;
                $iRecordSize 8;
                date_default_timezone_set('UTC');

                print 
                '<ol>';

                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);
                    }
                }
                print 
                '</ol>';
                ?>
                Results in:
                Code:
                <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>
                </ol>
                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 ;)

                Comment


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

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

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎