How can I retain indentation while using file_get_content with php?
问题 I am using the file_get_contents function in php to get the contents of a site. The problem is that on the site I am grabbing information from, the information is neatly indented, yet when I retrieve the information it looses all indentation. The code I am using is: <?php $url = "https://graph.facebook.com/btaylor"; $file = file_get_contents($url); echo "$file"; ?> If you go to the original site here, you can see how the information is set up as: { "id": "220439", "name": "Bret Taylor",