I'm trying to prase and use information I'm getting from an XML API in my system. The user is supposed to be able to choose between the returned agents and then select one of them. When they click "continue" or similar the rows of the agent that the user selected should be saved/assaigned to different PHP variables.
Here is the structure of the XML return:
<message>Your request was successfully processed.</message>
<name>AGENT & CO IT</name>
<address>STREET ADDRESS 2</address>
<address>STREET ADDRESS 5</address>
Now I need to list the agents so that the user can select one of them.. I've understood that I should use SimpleXML for this since it is the easiest way.
$xml = simplexml_load_file($request_url) or die("feed not loading");
That about what I've managed to do, I understand that in some way I need to list the different agents.
foreach ($xml-> ...? ) (
Then I would need to add so that the user can select one of the returned agents and click continue and that my script then can get the rows/information about the selected agent. Maybe HTML POST/GET but I don't know how to make it do that...
I appreciate any help, links, code or whatever I can use to solve this problem.