Read a line from an XML file with PHP
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Here is my XML file

I just want to read the version number (e.g. the number 2.26 -- here 2.26)

So on my CONTACT ME form, I can say "Make sure you have the latest version 2.26!"

Can you give me some php code that will read the version number from this xml file?

awarded to skram

Crowdsource coding tasks.

1 Solution

Winning solution

Here you go - (click "Run" to see the result)

hi thanks can you tell me how i would get it from the link though i can see how you did it from the string. but how would i do it from the actual file path?
tonloc over 7 years ago
Sure- just replace the $xmlstr assignment to $xmlstr = file_get_contents("");
skram over 7 years ago
(Full code:
skram over 7 years ago