![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
php过程中的一些问题
aifly_xst
这个作者很懒,什么都没留下…
展开
-
PHP反射 (Reflection) ReflectionFunction、ReflectionClass 类反射机制
ReflectionFunction ReflectionFunction 类报告了一个函数的有关信息。 可以获取函数的相关信息、如参数… <?php //ReflectionFunction $age = 10; $name = 'xst'; $function = function($age,$test = 5)use($name){ }; try { $reflect = new ReflectionFunction($function); } catch (Reflecti原创 2021-12-10 11:58:45 · 760 阅读 · 0 评论 -
dirname() basename() realpath() __DIR__ __FILE__ getpwd()
dirname( path , level ) 返回路径(path )目录部分。 level 为向上的层次,默认为1 basename( path , suffex ) 返回路径(path) 文件名部分 realpath( ) 返回规范化的绝对路径名 _ _DIR _ _ 当前文件的目录 _ _FILE _ _ 当前文件路径 getcwd() 当前工作目录 一些测试 echo "file1:__FILE__==> ".__FILE__.PHP_.原创 2021-12-10 10:17:36 · 385 阅读 · 0 评论 -
PHP脚本 生成千万mysql数据
<?php $servername = "127.0.0.1"; $username = "root"; $password = "root"; $dbname = "test"; $n = 10000; //每次生成的数据量 $k = 2000; //循环的次数 $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("连接失败: " .原创 2021-12-08 15:06:37 · 232 阅读 · 0 评论 -
composer 指定 php 版本
/www/server/php/74/bin/php【php位置】 /usr/bin/composer update原创 2021-11-13 13:33:07 · 552 阅读 · 0 评论 -
PHP debug
1.打印phpinfo(),然后复制到https://xdebug.org/wizard.php检测 2.根据步骤 1 下载对应的版本Xdebug,并导入dll文件,编辑php.ini 。下载地址 https://xdebug.org/download 3.配置 php.ini ,加入下列配置 [xdebug] zend_extension ="D:/wamp64/bin/php/php7.0.23/zend_ext/php_xdebug-2.5.5-7.0-vc14-x86_64.dll" #原创 2021-03-10 14:47:52 · 116 阅读 · 0 评论 -
PHP页面静态化
PHP页面静态化纯静态全部纯净态局部纯静态伪静态 静态页面相对于动态页面更容易被搜索引擎收录 访问静态页面不需要经过程序处理,因此可以提高运行速度 减轻服务器负担 纯静态 全部纯净态 ob_start() 打开缓冲区 ob_get_contents() 获取缓冲区内容 ob_end_flush() 输出缓冲区内容 <?php $file = 'index.html'; //输出缓存 1分钟过期 if(file_exists原创 2021-01-26 17:31:01 · 67 阅读 · 0 评论 -
PHP闭包
匿名函数(Anonymous functions),也叫闭包函数(closures),允许 临时创建一个没有指定名称的函数。最经常用作回调函数 callable参数的值。当然,也有其它应用的情况。 <?php $greet = function($name) { printf("Hello %s\r\n", $name); }; $greet('World'); $greet('PHP'); $message = 'hello'; // 没有 "use" 报错 $example .原创 2021-01-22 09:57:43 · 81 阅读 · 1 评论