你不用担心搜索引擎,应为它不会用file_get_contents这要来得

解决方案 »

  1.   

    现在搜索引擎的搜索关键字的机制差不多都已经变了,不用担心搜索引擎是如何处理的。对了,不建议用虚假信息欺骗搜索引擎。例如用hidden,字体颜色和背景颜色一致等。
      

  2.   

    ob_start();
    有了这句后,系统将把要显示的内容保存在内存的缓存中。
    要用$cont = ob_get_contents()把内容取出
    echo $cont;显示ob_gzhandler();是先把内容压缩再存储.
      

  3.   

    ob_gzhandler() is intended to be used as a callback function for ob_start() to help facilitate sending gz-encoded data to web browsers that support compressed web pages. Before ob_gzhandler() actually sends compressed data, it determines what type of content encoding the browser will accept ("gzip", "deflate" or none at all) and will return its output accordingly. All browsers are supported since it's up to the browser to send the correct header saying that it accepts compressed web pages. 不用我翻译了吧。
      

  4.   

    在 php.net 官网函数手册中,发表了这个Note,faisun at sina dot com 就是我啦:)
    http://cn.php.net/manual/en/function.ob-gzhandler.php
    ----------- faisun at sina dot com
    24-Apr-2007 12:53 
    My PHP version is 5.2.1 For windows.If browser doesn't support compressed ,
    ob_start('ob_gzhandler') returns the original string,
    but $str = ob_gzhandler ( $buffer, 5 ) returns false;<?php
    /* 1.php */
    ob_start('ob_gzhandler') ;
    echo 'This is a string.';
    ?><?php
    /* 2.php */
    header("Content-Encoding: gzip");
    $buffer = 'This is a string.';
    $str = ob_gzhandler ( $buffer, 5 ) ;
    if($str===false){
        echo 'ob_gzhandler() returns false.';
    }else{
        echo $str;
    }
    ?><?php
    /* 3.php */
    echo file_get_contents('http://www.php.net/1.php');
    echo file_get_contents('http://www.php.net/2.php');
    /*
    result:
    This is a string.ob_gzhandler() returns false.
    */
    ?> 
      

  5.   

    压缩输出,你可以看下mambo那个处理
      

  6.   

    if(strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip')!==false)
      ob_start('ob_gzhandler') ;你完全不加检查就使用gzip的后果当然是不支持gzip的浏览器无法查看你的网页了。象你的代码十有八九搜索引擎搜到的就是空白页。