لدي هذه الكود
$filesarray = array(
'http://45.32.233.5//file-1.php',
'http://45.32.233.5//file-2.php',
'http://45.32.233.5//file-3.php',
);
foreach($filesarray as $file){
if( strpos(file_get_contents($file),'class="vid-brahim"') !== false) {
echo $file;
break;
}
}
انا اريد من الكود ان يرسل User-Agent مثل هذا الكود
$url = "";
$options = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n" . // check function.stream-context-create on php.net
"User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" // i.e. An iPad
)
);
$context = stream_context_create($options);
$file = file_get_contents($url, false, $context);
التعليقات