1--TEST-- 2Test curl_getinfo() function with CURLINFO_CONTENT_TYPE parameter 3--CREDITS-- 4Jean-Marc Fontaine <jmf@durcommefaire.net> 5--SKIPIF-- 6<?php 7if (!extension_loaded("curl")) exit("skip curl extension not loaded"); 8if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined"); 9?> 10--FILE-- 11<?php 12 $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER'); 13 $url = "{$host}/get.php?test=contenttype"; 14 15 $ch = curl_init(); 16 curl_setopt($ch, CURLOPT_URL, $url); 17 curl_exec($ch); 18 var_dump(curl_getinfo($ch, CURLINFO_CONTENT_TYPE)); 19 curl_close($ch); 20?> 21===DONE=== 22--EXPECTF-- 23%unicode|string%(24) "text/plain;charset=utf-8" 24===DONE=== 25