I want get json from a url with file_get_contents
but it replace &
with &
and it dosnt work this way
i tried curl and happened again
i try url directly too and it worked ,so url haven't problem
$url="https://api.kavenegar.com/v1/asdkljsadlkjsd/sms/send.json?receptor=09148523669&sender=100005252&message=testing";
$json = file_get_contents($url);
echo "1";
var_dump($json);
and this is the result:
( ! ) Warning: file_get_contents(https://api.kavenegar.com/v1/asdkljsadlkjsd/sms/send.json?receptor=09148523669&sender=100005252&message=testing): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in C:\wamp64\www\te\func\testjson.php on line 22
Of course stackoverflow remove &
from result url.