PeteP Posted November 18, 2009 Share Posted November 18, 2009 Hi there, I'm looking to loop through the following XML array and be able to only display out every thing belonging under certain Queue Titles. How would I go about that? For example if queue title equals X then only displays child tags under X.. if it's Y then only display Y. Array ( [connector_ret] => Array ( [function] => Array ( [row] => Array ( [0] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 01 [1 attr] => Array ( [id] => 2 ) [1] => 243168 [2 attr] => Array ( [id] => 3 ) [2] => 090828-000300 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [1] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 01 [1 attr] => Array ( [id] => 2 ) [1] => 243515 [2 attr] => Array ( [id] => 3 ) [2] => 090831-000116 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [2] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 02 [1 attr] => Array ( [id] => 2 ) [1] => 244913 [2 attr] => Array ( [id] => 3 ) [2] => 090905-000022 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [3] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 03 [1 attr] => Array ( [id] => 2 ) [1] => 245323 [2 attr] => Array ( [id] => 3 ) [2] => 090907-000253 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [4] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 03 [1 attr] => Array ( [id] => 2 ) [1] => 245883 [2 attr] => Array ( [id] => 3 ) [2] => 090909-000207 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [5] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 04 [1 attr] => Array ( [id] => 2 ) [1] => 246884 [2 attr] => Array ( [id] => 3 ) [2] => 090914-000187 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [6] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 04 [1 attr] => Array ( [id] => 2 ) [1] => 246995 [2 attr] => Array ( [id] => 3 ) [2] => 090914-000298 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [7] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 04 [1 attr] => Array ( [id] => 2 ) [1] => 247338 [2 attr] => Array ( [id] => 3 ) [2] => 090915-000320 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [8] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 05 [1 attr] => Array ( [id] => 2 ) [1] => 247927 [2 attr] => Array ( [id] => 3 ) [2] => 090917-000207 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [9] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 06 [1 attr] => Array ( [id] => 2 ) [1] => 248588 [2 attr] => Array ( [id] => 3 ) [2] => 090921-000138 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) [10] => Array ( [col] => Array ( [0 attr] => Array ( [id] => 1 ) [0] => Queue Title 07 [1 attr] => Array ( [id] => 2 ) [1] => 249053 [2 attr] => Array ( [id] => 3 ) [2] => 090922-000280 [3 attr] => Array ( [id] => 4 ) [3] => Subject Name ) ) ) ) ) ) Thanks very much! Quote Link to comment https://forums.phpfreaks.com/topic/181977-loop-through-and-group-xml-data/ Share on other sites More sharing options...
RichardRotterdam Posted November 18, 2009 Share Posted November 18, 2009 Showing the XML (or part of it in case it's large) and the PHP code you're using would be more usefull instead of that var_dump code you posted. Quote Link to comment https://forums.phpfreaks.com/topic/181977-loop-through-and-group-xml-data/#findComment-959890 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.