} if (strstr($id, ".css")) { header('Content-Type: text/css; charset=utf-8'); } elseif (strstr($id, ".png")) { header('Content-Type: image/png'); } elseif (strstr($id, ".jpg") || strstr($id, ".jpeg")) { header('Content-Type: image/jpeg'); } elseif (strstr($id, ".gif")) { header('Content-Type: image/gif'); } else { header('Content-Type: text/html; charset=utf-8'); } echo $html; function byCurl($url) { $myCurl = curl_init(); curl_setopt_array($myCurl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, //CURLOPT_POST => true, //CURLOPT_POSTFIELDS => http_build_query([]) )); $response = curl_exec($myCurl); curl_close($myCurl); return $response; }