I'm new in this forum and new to PHP as well.
I already finished my first snapplets and enjoy learning PHP but right now I'm having issues with the following code:
Code: Select all
<?php
$Content = readfile("http://documentstat.issuu.com/090707215954-95c72a760f1d4248a6566f3e70e4ab6a/document_statistics.json");
echo $Content;
?>Code: Select all
http://documentstat.issuu.com/090707215 ... stics.jsonCode: Select all
‹[KoG ¾çW:µ@R 9¯]Ÿ ôÔKQ4n-Šb-¯Á²H²}üß;Ú‡d‹üä ˜ÀàÙù–3äÇÇÐÛ]³Ûþ7o–Ëëf~÷Ã×ÙÍzþpß®v˃Åv·˜og—_ß]\Ì~~l7ÛÅzU~ŸÑì}74¾ýëÍ~ÔÕ.»Ìë>Ôqž¹ÉÉÝÒMàP5)¦tëÛìÚÐ\§f\¡Ùµ¿¬—Ëv¾k»EعúƒËåçʹËîç'çÜßÃûËf»ûóË~Ö«·Ù]1_ÒéÛ‹öi/À,Ö™_Žý¾YŸ ?mÿ_¦ŠÓëÑáõ®×ë»ûfs·ý£·‹Çþk¸/_šOm7ñj½k–ÝÔÚ—}9}<®[;ïBÿpÿlÿÿ”_.ºßÿëçüöpÜý~ø aÈ>ŸŽË‡äÝ‹G‡Oï60κÏï1«xÁ{„çC„xoÉeû5ëá<#8÷6œX¶äP#8ª+GoÃE.A阃Aº¤Áq„ p\³7À ì× H:®T• p• —ÒLÎ&é„Jtk¦nfŠ–³#§âÅ Š#4ô)x*±pt‚F¼-–G*±àaùÈ´Ÿ€_*äÿŠiB¼)òéüa~DÑ”?H½ï£nŒ²Å?È8¬_TòêÏÄ/Açåóòç„ó :¿xìÿ|°ØŸ¬ ô‹ÂÂyÛ~êüâe\sÀ3U'‚Î/\Cûã ýí„™äÉ~QìoÇ/SôEç®à~r2ŸÎ/gå³øÛ¨ó ˸ô€çL¥A_XæiG<‹~F_p½ è§…¯£Î/\A~1âéüÂúw[½ êü‚ëÏ$ŸÎ/óKÈP?'ð‹ôý¢øüŽ'¦È§ó ®–O1ŸÎ/¡FõOcÄ/°þRÎÏ¢ŸIç—ë/ðÅÑ<_®O¼¾Ãúf<¿dOD‹?J ~Éм©ž%Ïiò§7ÕC’Î/>ÁøÚ›î;’Î/^æ…ß'þ”r ñ'ŽçÅþ¤^ôNçÓlªOd¿È¼âˆgºlñ ¼¯"ª,ùJÖù…*¨ŸdòYç’q÷ÏT‘¼5àA{ ¶ØCù‘¬«ô…,õÈ ò#ìØ&Ȱÿcìÿ&äåGX¾`ÙOy6, íM2ŽV’¼“ó³Ø{øEòÜ/šº@~$ýâñü,ö.ã¾?aÁûð‚g±?YçâAšzmd4àÁx0ØôSç— ýÔ1Þ5é Ȱ&¾–u%)9‘Ïʺêp~ÐßS¼$óÊ!Ãùm0áüÇgÁtß(;öÞ>?“¾èüä½ÒQ>“¾~ígåSLçøåŒý±ÅßÖ€_p?ƒ¯,üRƒü×—|²õ×éãaL‰¯m€:ÃxÙÉq4u ÉTèm—kqñä@ #{Ó¾ H’¤±“2S“–ì®éW•Õæc–~BTON§E™F@—-aÉþ½~v`“3ÝëÓ‰ÆÁF×r6@ipgXQ3K¤Fz+o‘j©K¶V^i®8S,Cz3oÙi¬¥6¥Ñ»yË–B¦±n)`œ.9|Ý2 Pgš³farOzCoÔã…Rùÿßý+³Ý¦¹½]Ì?®6sõO\VÍ}»Ÿù°º[ŸV/þ¼Øuk†ýêrŒ“ÛíÃ2µë-;?õf±iç;e.];?uÓÞ¶›ÍbõI™ÐÕÚ8yÛ6›ùg ÷ž{~þñç¿Q®51593Of course I tried several things like file() or file_get_contents () but the output is messed up in either way.
I suspect it could have something to do with UTF and such? Because when I copy the content from the browser window and paste it into a .txt/.json file and open this with the same code but from my local harddrive it works well. My goal is to open the file from the URL and to work with the content in arrays and such.
I dont expect a ready made solution but hints in which direction I should go are much appreciated!
EDIT: I work with PHP Version 5.2.9