|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-27 01:12 UTC] sterling@php.net
[2002-02-01 15:52 UTC] dlb at gmx dot ch
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
function fetchHeader($url, $returntransfer) { $ch = curl_init ($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, $returntransfer); curl_setopt ($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_exec ($ch); } $arrTestUrl = array("www.alle-autos.ch", "www.alpendrifter.ch", "www.cam-schweiz.ch", "www.bwinfo.ch", "www.canonshop.ch", "www.bmparch.ch","www.jahaya.ch"); reset($arrTestUrl); foreach($arrTestUrl as $currUrl) { echo $currUrl . "<br>"; flush(); $currUrl = "http://" . $currUrl; fetchHeader($currUrl,0); } Running the above script generates no error. In my case the script crashed when using fetchHeader($currUrl,1) instead of fetchHeader($currUrl,1), for every given url. I am using the curl that comes with php 4.1.1 and php as a CGI executable.