file_get_contents with spaces in URL

前端 未结 2 1103
渐次进展
渐次进展 2021-01-12 04:02

I have an issue where even if I replace the spaces to %20 and get this content the ultimate url the browser gets turns the \"%20\" into \"%2520\"

Here\'s my code, an

相关标签:
2条回答
  • 2021-01-12 04:51
    $song = $_GET['song']);
    
    $url = "http://www.lyrdb.com/lookup.php?for=fullt&q=";
    
    echo "list url is " . htmlentities($url . $song) . "<hr>";
    
    $content = file_get_contents($url . urlencode($song));
    
    echo $content;
    
    0 讨论(0)
  • 2021-01-12 04:54
    $data = json_encode($_POST);
    
    $url = "http://www.index.com?data=";
    
    echo file_get_contents($url . urlencode($data));
    
    0 讨论(0)
提交回复
热议问题