Hi,
I want to know if this is possible by QP. I have a xml structure like this

?contactWebsites? HTTP://WWW.a.COM/ ?/contactWebsites?
?contactWebsites? HTTP://WWW.b.COM/ ?/contactWebsites?
?contactWebsites? HTTP://WWW.c.COM/ ?/contactWebsites?
?contactwebsiteSize? 3 ?/contactwebsiteSize?

* I have replaces triangular brackets by question marks

Now I want to traverse the xml so that I can store all 3 websites in a single field as comma separated value. For eg as a,b,c.

I have done something like this

$numberofweburl = $update_profile->top('contactwebsiteSize')->text();

             for($i=0;$i<=$numberofweburl;$i++){
				// dont know what to write here !!
	     }

Now I don't know if it is possible, if yes can anyone let me know how ?

Comments

mbutcher’s picture

It can be done in one line:


// Gives you "http://www.a.com,http://www.b.com,http://www.c.com"
$urls = qp($xml, 'contextwebsiteSize')->textImplode(',');

mbutcher’s picture

Issue summary: View changes

triangular brackets are not shown