转载至:https://phper.shujuwajue.com/shu-zu/shu-ru-liu-php-input $_POST 与 php://input 仅在取值为application/x-www-data-urlencoded和multipart/form-data时(文件上传时),
使用PHP连接MySQL 8的时候,可能会发生如标题所示的错误: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client 发生这种错误,是由于MySQL 8默认使用了新的密码验证插
stream_context_create作用: 创建并返回一个文本数据流并应用各种选项,可用于fopen(),file_get_contents()等过程的超时设置、代理服务器、请求方式、头信息设置的特殊过程。 参考:http://php.net/manual/zh/function.stream
背景:解决magento2安装过程中缺少php扩展的问题:ext-intl和ext-xsl Loading composer repositories with package information Installing dependencies (including require-dev)
使用PHP GD库函数生成带文字图片,CSS3的border-radius为元素添加圆角边框。 image.php <?php //1.创建画布 $img = imagecreatetruecolor(120, 120); //2.背景颜色 $color =
CBC模式一定要指定IV加密向量 ECB模式不需要指定IV加密向量 class TripleDes { /** * @var string */ var $key = ''; /** * @var string
为了防止在支付通信过程中的参数数据被篡改或者伪造,采用RSA进行数据签名和验证签名。 RSA算法是一种非对称密码算法,所谓非对称,就是指该算法需要一对密钥,使用其中一个加密,则需要用另一个才能解密。 生成公私钥 生成 RSA 私钥 PEM 文件: # openssl genrsa -out rsa
正则表达式:^[^c],其中c为字符 例一:首字符不能为a $test1 = "a123456"; //匹配失败 if (preg_match("/^[^a]/", $test1)) { echo '匹配成功<hr />�
$result = \file_get_contents('php://input'); 解决方法:Form表单的Content-Type应设置为application/x-www-form-urlencoded(默认),不能是multipart/form-data
PHP实现图片等比例缩略图,生成正方形缩略图。 步骤:待压缩正方形图片的边长为原始图片宽度和高度的像素最小值,图片宽高较长的一边裁剪中间部分,再实现像素压缩。 <?php $imgpath = 'test.jpg'; if (!empty($imgpath)) {
$params = array(); foreach ($_POST as $key => $value) { $params[$key] = $value; } echo request_post($url, $params); function request_post($ur
PHP下划线和驼峰字符串相互转换 class AppBlogString { /* * 下划线转驼峰 */ public static function convertUnderline($str) { $str = preg_repla
iconv 和 mb_convert_encoding 的区别 string iconv(string in_charset, string out_charset, string str) 注意:第二个参数,除了可以指定要转化到的编码以外,还可以增加两个后缀://TRANSLIT 和 //IGN
igbinary 官网:http://pecl.php.net/package/igbinary Github:https://github.com/igbinary/igbinary/ # wget http://pecl.php.net/get/igbinary-2.0.1.tgz # t
以ip.cn为例,根据IP地址在线查询省市区 <?php $url='https://ip.cn/index.php?ip=8.8.8.8'; $data["country"] = 'unknown'; $data["r