Create Listdata From Multi-Dimensional Array

I have a simpleXML file someFile.xml


<?xml version="1.0" encoding="UTF-8"?>

<Requests><request>

        <id>13836</id>

        <title>13836 | My request</title>

        <status>PENDING</status>

        <abstract>Huge element request</abstract>

        <originator>User 1</originator>

        <start>2014-05-16 08:00:00</start>

        <stop>2014-05-24 14:00:00</stop>

</request>

<request>

        <id>13835</id>

        <title>13835 | request | User</title>

        <status>PENDING</status>

        <abstract>element request</abstract>

        <originator>User 2</originator>

        <start>2014-05-16 08:00:00</start>

        <stop>2014-05-24 14:00:00</stop>

</request>

</Requests>



I convert this to an Array


Array

(

    [request] => Array

        (

            [0] => Array

                (

                    [id] => 13836

                    [title] => 13836 | My request

                    [status] => PENDING

                    [abstract] => My request

                    [originator] => User 1

                    [start] => 2014-05-16 08:00:00

                    [stop] => 2014-05-24 14:00:00

                )


            [1] => Array

                (

                    [id] => 13835

                    [title] => 13835 | request | User

                    [status] => PENDING

                    [abstract] => element request

                    [originator] => User 2

                    [start] => 2014-05-16 08:00:00

                    [stop] => 2014-05-24 14:00:00

                )

)

How can I use [font="Courier New"]CHtml::listData()[/font] to put this into something readable for a [font="Courier New"]CHtml::dropDownList()[/font]?

I want the dropDownList value = id and [b]option = title

[/b]Any ideas?

Assuming that $requests variable contains an array with the structure above:




CHtml::listData($requests['request'], 'id', 'title');



Worked PERFECTLY. Thank you! Not sure why I didn’t try that option of [font=“Courier New”]$requests[‘request’][/font]

Thanks a million!