How to speed up file_get_contents?
问题 Here's my code: $language = $_GET['soundtype']; $word = $_GET['sound']; $word = urlencode($word); if ($language == 'english') { $url = "<the first url>"; } else if ($language == 'chinese') { $url = "<the second url>"; } $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"User-Agent: <my user agent>" ) ); $context = stream_context_create($opts); $page = file_get_contents($url, false, $context); header('Content-Type: audio/mpeg'); echo $page; But I've found that this runs terribly slow.