Results 1 to 3 of 3

Thread: How to Retriev File Statistic in PHP

  1. #1
    Join Date
    Apr 2009
    Posts
    69

    How to Retriev File Statistic in PHP

    I am looking for a PHP website statistics script, one that uses php which includes to gather visitor information, I hope this is possible and if this is possible then i can use in my daily routine, so please suggest me does something like this exist?

    Thanks for your reply.

  2. #2
    Join Date
    Dec 2008
    Posts
    202

    Re: How to Retriev File Statistic in PHP

    To analyze XML documents, you can install and use the XML_Statistics package, which provides methods for obtaining statistics about tags, attributes, entities, processing instructions, data blocks, and CDATA sections for any well-formatted XML document.

    To install the PEAR, use this command (version 0.1 is the beta version):
    -> pear install -alldeps XML_Statistics-0.1

    XML document used for test purposes in the example code.

    The following PHP example uses the XML document in Listing 1 to retrieve some basic statistics about tags, attributes, and CDATA sections:

    PHP Code:
       <?php
         
    //import Statistics.php
         
    require_once 'XML/Statistics.php';
           
         
    //ignore whitespaces
         
    $stat = new XML_Statistics(array("ignoreWhitespace" => true));
           
         
    //analyze a file or URL
         
    $result $stat->analyzeFile("myxml.xml");
           
         if (
    $stat->isError($result)) {
           die(
    "Error: " $result->getMessage());
         } 
         else 
         {        
           
    // total number of tags
           
    echo "Total tags: " $stat->countTag()."<br>";
           
           
    // count number of 'type' attribute
           
    echo "Occurences of attribute type: " $stat->countAttribute("type")."<br>";
                 
           
    // get the maximum depth
           
    echo "Maximum depth: " $stat->getMaxDepth()."<br>";
       
           
    // count total number of tags in depth 3
           
    echo "The number of tags in depth 3: " $stat->countTagsInDepth(3)."<br>";
           
           
    // count the occurences of data blocks
           
    echo "Data chunks: " $stat->countDataChunks()."<br>";
       
           
    // get the length of all CData sections
           
    echo "Length of all data chunks: " $stat->getCDataLength()."<br>";
         }
       
    ?>
    The output of this example is:

    Total tags: 16
    Occurences of attribute type: 2
    Maximum depth: 3
    The number of tags in depth 3: 10
    Data chunks: 6
    Length of all data chunks: 93

  3. #3
    Join Date
    Oct 2008
    Posts
    167

    Re: How to Retriev File Statistic in PHP

    PHP website Usage Statistics script is used to view the number of hits made by online customers, number of clicks per page, their IP address, unique customers IP address, search engine tracking(Google) and referer site etc., These informations will be shown in numerical value through MySQL database.

Similar Threads

  1. Replies: 4
    Last Post: 04-04-2012, 01:12 AM
  2. Statistic of Crimson Steam Pirates game
    By Omanand in forum Video Games
    Replies: 2
    Last Post: 03-09-2011, 07:19 AM
  3. Replies: 3
    Last Post: 28-01-2011, 06:26 AM
  4. Enable linux Process IO statistic accounting
    By Unix'EM in forum Operating Systems
    Replies: 3
    Last Post: 10-08-2009, 07:37 PM
  5. Replies: 3
    Last Post: 16-07-2009, 01:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,638,601.68375 seconds with 16 queries