PHP - Full XML in var_dump

2

Good afternoon, I'm wanting to see the complete xml coming from a web service SOAP response, but when I put var_dump it shows only half of it, the other part is replaced by the word " ... (length=740) ". How do I see it complete?

    
asked by anonymous 10.07.2015 / 19:07

1 answer

1

Printing the xml from a file_get_contents is possible with a simple echo

$file = file_get_contents('http://example.com/rss');
echo $file;

There are two more ways:

print ($file);

or using the asXML method:

$xml->asXML('filename.xml');

To work with asXML you must have a SimpleXMLElement object that can be seen in this decoupling: Link

OBS: If you have xdebug installed it will truncate the result of var_dump to prevent browser crashes, this is the information link Link

  

There are a number of settings that control the output of Xdebug's   modified var_dump () function: xdebug.var_display_max_children,   xdebug.var_display_max_data and xdebug.var_display_max_depth.

    
10.07.2015 / 19:10