Posts

Showing posts with the label PHP

SAX parsing for cdata tag for large xml file

     Here, I have given the code for parsing or reading large xml files using php.      Large xml files in php  are parsed using this  SAX  parser. The inner function of php, which gives directly the data of xml, can handle only small xml files (mostly upto 1KB to 50KB). So for parsing large xml files having data like 5MB, 50MB, etc. we have to use this method.      The code is given as simple as possible. Just enter your xml file path in 5th line. The 30th line gives the switch cases. Each switch case has one tag name of xml file. So if we want to perform any search or value of that tag or some other operation also can be done in that switch case area. From 54th line, we can do ending operation of that xml file. For ex. if we want to put data in table, we can complete table tag there.      The cdata tag is parsed in characterdata function on line 73. All cdata tag is parsed there and we can perform operat...

Install Pear in Wamp Server 2.2 (with php 5.3.8) for windows

First of all, install wamp 2.2 from  Wamp server 2.2 . After that download pear from below. DOWNLOAD PEAR Then run following command in the command prompt. C:\wamp\bin\php\php5.3.0>php go-pear.phar Are you installing a system-wide PEAR or a local copy? (system|local) [system] : system Below is a suggested file layout for your new PEAR installation.  To change individual locations, type the number in front of the directory.  Type 'all' to change all of them or simply press Enter to accept these locations. 1. Installation base ($prefix)                   : C:\wamp\bin\php\php5.3.0 2. Temporary directory for processing            : C:\wamp\bin\php\php5.3.0\tmp 3. Temporary directory for downloads             : C:\wamp\bin\php\php5.3.0\tmp 4. Binaries direc...