![]() |
How to read xml file line by line and extract a particular tag???
EXAMPLE:
<xml> <title> Sample </title> <heading1> PERL </heading1> <body> <code> <heading2> Definition 1: </heading2> Perl is a high-level, general-purpose, interpreted, dynamic programming language. Information from <link> google.com</link> <heading3> Definition 2: </heading3> A program language that is considered public domain and hence not technically supported by a vendor. Is very popular due to the fact that it is free. Many claim that it is easier to use than JAVA and JAVA's predecessor C++. Information from <link> state.tn.us</link> </code> </body> </xml> How to extract the tag <link> from the file by reading line by line. Guide me how to go about it? And what changes would I have to make if I wanted the output as: Definition1: link name Definition2: link name |
Re: How to read xml file line by line and extract a particular tag???
PHP Code:
Code:
Definition 1Remember to replace the $file variable with the name of your xml file. |
| All times are GMT +5.5. The time now is 20:22. |