msgbartop
PHP语言, PHP扩展, Zend引擎相关的研究,技术,新闻分享 – 左手代码 右手诗
msgbarbottom

10 Aug 08 留言


分享到:



402 Responses to “留言”

Pages: [41] 40 39 38 371 » Show All

  1. wiml |

    t.php里面的内容就是:
    <?php
    echo time();

  2. lpf |

    请教一个技术问题:
    function g($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//不要输出,在curl_exec中返回

    $ret = curl_exec($ch);
    $errno = curl_errno($ch);
    if($errno){
    echo ‘Curl error #’.$errno.’: ‘ . curl_error($ch);
    $ret = ”;
    }
    curl_close($ch);
    return $ret;
    }
    用这段代码请求一个本的URL:
    for ($i=1; $i<=30000; $i++){
    $sec = g('http://192.168.1.8/test/t.php&#039 ;) ;
    if ($sec == ''){
    break;
    }
    echo $i.' ';
    flush();
    }
    请求到28000多次时,就会报:
    Curl error #7: Failed to connect to 192.168.1.8: Cannot assign requested address
    但http://192.168.1.8/test/t.php肯定没问题,我用浏览器访问,一切正常,用上面的g函数就是不行,但只要等个一分钟左右,就又恢复了可以了

Pages: [41] 40 39 38 371 » Show All

Leave a Reply

*