I started using the phpquery thingy, but I got lost in all that documentation. In case someone does not know what the hell I am talking about: http://code.google.com/p/phpquery/
My question is pretty much basic. I succeeded at loading an XML document and now I want to parse all the tags from it.
Using pq()->find('title')
I can output all of the contents inside the title tags. Great!
But I want to throw every <title>
tag in a variable. So, lets say that there are 10 <title>
tags, I want every one of them in a separate variable, like: $title1
, $title2
... $title10
. How can this be done?
Hope you understand the question. TIA!
You could do it like this:
For example if there are 3 titles in the
$content
thisvar_dump
will output: