Results 1 to 4 of 4

Thread: number of entries in file

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    number of entries in file

    at the moment my file is just a text file on the web, so i just view it like

    www.my-site.com/scores.txt

    which gives me all the scores, eg..

    mark=5644
    john=4544 etc..

    but is there a way i can make something to show me the total number of entries in the text file?

  2. #2
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    Re: number of entries in file

    Is your file always in that format, as in each entry is on a new line? If so, you could use explode() with the newline character as the delimiter, and then use count() to get the number of entries.

    Good luck
    {yak}

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: number of entries in file

    thanks but at the top of this file, is it possible to have smething like:

    Total number of entries in this text file: x

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: number of entries in file

    Yes. Just use a vairable in the PHP script which creates it to count the number of lines.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width