网络编程 
首页 > 网络编程 > 浏览文章

不常用但很实用的PHP预定义变量分析

(编辑:jimmy 日期: 2025/12/28 浏览:3 次 )

1. $php_errormsg — 前一个错误信息

<"htmlcode">
<"http://example.com");

 var_dump($http_response_header);

}

get_contents();

var_dump($http_response_header);

"htmlcode">
<"htmlcode">
<"htmlcode">
var_dump(__FILE__); //所在路径文件名和文件名称   E:\demo\blog_code\predefined\predefined.php
var_dump(__DIR__); //所在完整目录         E:\demo\blog_code\predefined
var_dump(__LINE__); //代码所在行号         4
class testClass{
  function testMethod(){
    var_dump(__FUNCTION__); //返回当前方法名  testMethod
    var_dump(__CLASS__);  //返回类名     testClass
    var_dump(__METHOD__);  //类名加方法名   testClass::testMethod
  }
}
 
$a=new testClass();
$a->testMethod();

上一篇:PHP实现的抓取小说网站内容功能示例
下一篇:PHP中define() 与 const定义常量的区别详解
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。