Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 14-04-2009
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.
Reply With Quote
Old 14-04-2009
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:
//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)) {
"Error: " $result->getMessage());
// 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
Reply With Quote
Old 14-04-2009
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.
Reply With Quote

  TechArena Community > Software > Software Development
Tags: , , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "How to Retriev File Statistic in PHP"
Thread Thread Starter Forum Replies Last Post
How can I convert LaTeX file to OpenOffice .odt file and MS Word .doc file? Charu Sharma Windows Software 4 04-04-2012 01:12 AM
Statistic of Crimson Steam Pirates game Omanand Video Games 2 03-09-2011 07:19 AM
Dead space 2 error while installation "Source file not found: (file destination)...Verify that file exists Ucchal Video Games 3 28-01-2011 06:26 AM
Enable linux Process IO statistic accounting Unix'EM Operating Systems 3 10-08-2009 07:37 PM
How can i make .cab file and would like to add file to an existing cab file Kamran Operating Systems 3 16-07-2009 01:29 PM

All times are GMT +5.5. The time now is 04:48 AM.