Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
25% Recurring Discount on NVMe VPS
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

XPath problem in PHP

dnwkdnwk Member
edited May 2014 in Help

I am using XPath in PHP to search for 1 information. Every XPath test tool can find the information with that XPath Query. However, PHP doesn't deliver it. Anyone know what's the problem?
Thanks

Here is the XML Source: http://pastebin.com/8ykGpASr

And here is my PHP code for Xpath

$xml = new SimpleXMLElement($html); $xml->registerXPathNamespace('ssopenurl', 'http://xml.serialssolutions.com/ns/openurl/v1.0'); $url = $xml->xpath('//ssopenurl:url[@type="article"]'); var_dump($url);

Comments

  • nerouxneroux Member

    What does xpath() return? An empty array or false? I tried it and it returns an array with one element.

  • vedranvedran Veteran

    Same here, you probably messed up somewhere before, check if $html is really what's it supposed to be.

  • dnwkdnwk Member

    If I search for other node, it will return fine.

  • dnwkdnwk Member

    Oops. Yes. You are right. $html is not what I though they should be.

Sign In or Register to comment.