php - failed to open stream: Invalid argument with exclamation marks in URL -


https://www.google.co.uk/s?tbm=map&fp=1&gs_ri=maps&suggest=p&authuser=0&hl=en&pb=!2i14!4m12!1m3!1d36371.595804441626!2d-2.4949300500000002!3d53.74963355!2m3!1f0!2f0!3f0!3m2!1i1600!2i740!4f13.1!7i10!10b1!12m6!2m3!5m1!2b0!20e3!10b1!16b1!19m10!1e1!1e13!1e2!1e5!1e3!1e10!1e12!1e15!1e27!4smaps_sv.tactile!20m49!1e1!1e13!1e2!1e5!1e11!1e4!1e3!1e10!1e12!1e15!1e27!2m2!1i203!2i100!3m1!2i4!5smaps_sv.tactile!6m3!1m2!1i86!2i86!7m26!1m3!1e1!2b0!3e3!1m3!1e2!2b1!3e2!1m3!1e2!2b0!3e3!1m3!1e3!2b0!3e3!1m3!1e4!2b0!3e3!1m3!1e3!2b1!3e2!2b1!4b1!9b0!22m3!1sjf4ovtpahmj-ul_-hugd!3b1!7e81!23m1!4b1!26m9!1e12!1e15!1e13!1e3!1e27!2m2!1i80!2i80!4smaps_sv.tactile!37m1!1e81&q=downing%20street&pf=p&tch=1&ech=14&psi=jf4ovtpahmj-ul_-hugd.1443823133674.1

when trying read .txt file shows on url above fopen returns failed open stream: invalid argument.

i have tried urlencode gives same error

<?php $url = "https://www.google.co.uk/s?tbm=map&fp=1&gs_ri=maps&suggest=p&authuser=0&hl=en&pb=!2i14!4m12!1m3!1d36371.595804441626!2d-2.4949300500000002!3d53.74963355!2m3!1f0!2f0!3f0!3m2!1i1600!2i740!4f13.1!7i10!10b1!12m6!2m3!5m1!2b0!20e3!10b1!16b1!19m10!1e1!1e13!1e2!1e5!1e3!1e10!1e12!1e15!1e27!4smaps_sv.tactile!20m49!1e1!1e13!1e2!1e5!1e11!1e4!1e3!1e10!1e12!1e15!1e27!2m2!1i203!2i100!3m1!2i4!5smaps_sv.tactile!6m3!1m2!1i86!2i86!7m26!1m3!1e1!2b0!3e3!1m3!1e2!2b1!3e2!1m3!1e2!2b0!3e3!1m3!1e3!2b0!3e3!1m3!1e4!2b0!3e3!1m3!1e3!2b1!3e2!2b1!4b1!9b0!22m3!1sjf4ovtpahmj-ul_-hugd!3b1!7e81!23m1!4b1!26m9!1e12!1e15!1e13!1e3!1e27!2m2!1i80!2i80!4smaps_sv.tactile!37m1!1e81&q=downing%20street&pf=p&tch=1&ech=14&psi=jf4ovtpahmj-ul_-hugd.1443823133674.1"; $myfile = fopen(urlencode($url), "r") or die("unable open file!"); echo $myfile; fclose($myfile); ?> 

first, if try open urlencode($url) access

https%3a%2f%2fwww.google.co.uk%2fs%3ftbm%3dmap%26fp%3d1%26gs_ri%3dmaps%26suggest%3dp%26authuser%3d0%26hl%3den%26pb%3d%212i14%214m12%211m3%211d36371.595804441626%212d-2.4949300500000002%213d53.74963355%212m3%211f0%212f0%213f0%213m2%211i1600%212i740%214f13.1%217i10%2110b1%2112m6%212m3%215m1%212b0%2120e3%2110b1%2116b1%2119m10%211e1%211e13%211e2%211e5%211e3%211e10%211e12%211e15%211e27%214smaps_sv.tactile%2120m49%211e1%211e13%211e2%211e5%211e11%211e4%211e3%211e10%211e12%211e15%211e27%212m2%211i203%212i100%213m1%212i4%215smaps_sv.tactile%216m3%211m2%211i86%212i86%217m26%211m3%211e1%212b0%213e3%211m3%211e2%212b1%213e2%211m3%211e2%212b0%213e3%211m3%211e3%212b0%213e3%211m3%211e4%212b0%213e3%211m3%211e3%212b1%213e2%212b1%214b1%219b0%2122m3%211sjf4ovtpahmj-ul_-hugd%213b1%217e81%2123m1%214b1%2126m9%211e12%211e15%211e13%211e3%211e27%212m2%211i80%212i80%214smaps_sv.tactile%2137m1%211e81%26q%3ddowning%2520street%26pf%3dp%26tch%3d1%26ech%3d14%26psi%3djf4ovtpahmj-ul_-hugd.1443823133674.1

that's invalid.

second, $myfile resource. need work that, example:

$url = "https://www.google.co.uk/s?tbm=map&fp=1&gs_ri=maps&suggest=p&authuser=0&hl=en&pb=!2i14!4m12!1m3!1d36371.595804441626!2d-2.4949300500000002!3d53.74963355!2m3!1f0!2f0!3f0!3m2!1i1600!2i740!4f13.1!7i10!10b1!12m6!2m3!5m1!2b0!20e3!10b1!16b1!19m10!1e1!1e13!1e2!1e5!1e3!1e10!1e12!1e15!1e27!4smaps_sv.tactile!20m49!1e1!1e13!1e2!1e5!1e11!1e4!1e3!1e10!1e12!1e15!1e27!2m2!1i203!2i100!3m1!2i4!5smaps_sv.tactile!6m3!1m2!1i86!2i86!7m26!1m3!1e1!2b0!3e3!1m3!1e2!2b1!3e2!1m3!1e2!2b0!3e3!1m3!1e3!2b0!3e3!1m3!1e4!2b0!3e3!1m3!1e3!2b1!3e2!2b1!4b1!9b0!22m3!1sjf4ovtpahmj-ul_-hugd!3b1!7e81!23m1!4b1!26m9!1e12!1e15!1e13!1e3!1e27!2m2!1i80!2i80!4smaps_sv.tactile!37m1!1e81&q=downing%20street&pf=p&tch=1&ech=14&psi=jf4ovtpahmj-ul_-hugd.1443823133674.1"; $myfile = fopen(($url), "r") or die("unable open file!"); echo stream_get_contents($myfile); fclose($myfile); 

or just

echo file_get_contents($url); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -