Sedang Disiapkan

XML parser function in PHP

I need a function in PHP that parses a webpage with XML and arrange the output in nodes with Xpath. I want to call the functions with a couple of paramaters and I want the output to be structured with nodes. So I easily can use Xpath code to extract additional data from the Webpage.

In parameter:

1) Starturl

2) Xpath expr (default:None) - An expression can look like this //head/meta

3) Force encoding/charset (Default: Use the charset from Starturl meta)

4) Accept gzip-encoded response (Default: Yes) - The class need to handle these encoded reponds

5) User-Agent - Be able to change the user agent

The output should be structured in Xpath nodes (See attached image), for each time I call the function with an Xpath expression (2) I get further down the structured XML three. Finally I can for example extract an image link or a text field.

If you have more questions ask me in PM.

Kemahiran: PHP

Lihat lebih lanjut: xml parser function, xpath and or, in php, xml parser php, extract user agent php, php xml parsing function, php xml parse class, xml sweden function, arrange webpage php, php xml useragent, php xpath arrange, user agent php xml parser, php arrange xml, user agent parser, xml parser, webpage php, user agent, structured, php encoded, gzip, function, encoded, call handle, arrange, additional php

Tentang Majikan:
( 15 ulasan ) Stockholm, Sweden

ID Projek: #300195