Parser
Parser copied to clipboard
Parsing XML Example
Is it possible to just get a complete example of parsing XML for a specific key using the Facade?
Currently I'm able to convert the whole XML structure into an array using
$xml = Parser::xml($response);
however is there a way to specific pull keys? Using the documentation it would be something like
Parser::get('key', 'default value');
but I don't know how to tie it all together.
Thanks
Please read through the other most recent issues. This topic has come up a lot in the last week or so.
Yeah documentation SUCKS. cannot figure out how to use get function.
Basically, Parser::get()
, along with all the other helper methods, can only look at the HTTP request body. If the data you want to parse isn't in there, you can't use the helpers. They cannot be used on variables.
OH.... now it's more logic. I think you should add this info near function description or in documentation.
Agreed.
(Note: this explanation had already been given in other, older issues.)