Iam new to xpath. I got a url using curl and domdocument but the problem is that the link is formated in this way: /bookstore/book.php So then I wanna echo it to my own href link, it doesnot work ofcourse. The awnser would be to make a variable thats contains both the www.hello.com and the link I got from domdocument.
Here is my line of code:
$link = $linkquery->item(2)->nodeValue;
But if I do this it just gives me an 0
$url = "http://www.hello.com" + $link;
Any ideas? I guess I have missed something basic.
Regards
EDIT
Thanks for the help, the awnser was $url = "http://www.hello.com$link";
$xpath->evaluate('string(//nodename[3])'), not$xpath->query('//nodename')->item(2)->nodeValue;- ThW