Call to undefined function apache_request_headers()

前端 未结 6 964
广开言路
广开言路 2020-11-27 04:58

I\'ve just switched my scripts to a different server. On the previous server this worked flawlessly, and now that I\'ve switched them to a different server, I can\'t underst

6条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 05:35

    You can use the following replacement function:

     $val) {
        if( preg_match($rx_http, $key) ) {
          $arh_key = preg_replace($rx_http, '', $key);
          $rx_matches = array();
          // do some nasty string manipulations to restore the original letter case
          // this should work in most cases
          $rx_matches = explode('_', $arh_key);
          if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) {
            foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val);
            $arh_key = implode('-', $rx_matches);
          }
          $arh[$arh_key] = $val;
        }
      }
      return( $arh );
    }
    ///
    }
    ///
    ?>
    

    Source: PHP Manual

提交回复
热议问题