Problem with php code when using & symbol in the link

  php

Hi,

i have this code php

$url = "http://dikoiptv.zapto.org:25461/get.php?username=202020212022&password=303202404&type=m3u_plus&output=hls" ; 
if(isset($url)) {
  $m3ufile = file_get_contents($url);
echo $m3ufile ;
}

enter image description here

When I call the page the code does not work and this error appears in the file of error_log

[06-Mar-2021 18:52:45 UTC] PHP Warning:  file_get_contents(http://dikoiptv.zapto.org:25461/get.php?username=202020212022&password=303202404&type=m3u_plus&output=hls): failed to open stream: Connection refused in /home/wwww/public_html/video/index.php on line 4

The problem with replacing this & in the link to & amp;
Is there a solution to this problem, thank you

Source: Ask PHP

LEAVE A COMMENT