Learning Path
浏览 PHP 相关教程与章节。
PHP、Node.js、Java Web、Python Web 框架、API 与服务端开发。
教程
844
PHP imagecolordeallocate - 取消图像颜色的分配 PHP 图像处理 imagecolordeallocate — 取消图像颜色的分配。 语法 bool imagecolordeallocate ( resource $image , int $color ) imagecolordeallocate() 函数取消先前由 imagecolorallocate() 或 imagecolorallocatealp..
PHP imagecolorexact - 取得指定颜色的索引值 PHP 图像处理 imagecolorexact — 取得指定颜色的索引值。 语法 int imagecolorexact ( resource $image , int $red , int $green , int $blue ) 返回图像调色板中指定颜色的索引值。 如果颜色不在图像的调色板中,返回 -1。 如果从文件创建了图像,只有图像中使用了的颜色会被辨析。..
PHP imagecolorexactalpha - 取得指定的颜色加透明度的索引值 PHP 图像处理 imagecolorexactalpha — 取得指定的颜色加透明度的索引值。 语法 int imagecolorexactalpha ( resource $image , int $red , int $green , int $blue , int $alpha ) 返回图像调色板中指定颜色加透明度的索引值。 注意:此函数..
PHP imagecolormatch - 使一个图像中调色板版本的颜色与真彩色版本更能匹配 PHP 图像处理 imagecolormatch — 使一个图像中调色板版本的颜色与真彩色版本更能匹配。 语法 bool imagecolormatch ( resource $image1 , resource $image2 ) 使一个图像中调色板版本的颜色与真彩色版本更能匹配。 注意:此函数仅在与 GD 库捆绑编译的 PHP 版本中..
PHP imagecolorresolve - 取得指定颜色的索引值或有可能得到的最接近的替代值 PHP 图像处理 imagecolorresolve — 取得指定颜色的索引值或有可能得到的最接近的替代值。 语法 int imagecolorresolve ( resource $image , int $red , int $green , int $blue ) 本函数可以保证对所请求的颜色返回一个颜色索引,要么是确切值要么是..
PHP imagecolorresolvealpha - 取得指定颜色加透明度的索引值或有可能得到的最接近的替代值 PHP 图像处理 imagecolorresolvealpha — 取得指定颜色加透明度的索引值或有可能得到的最接近的替代值。 语法 int imagecolorresolvealpha ( resource $image , int $red , int $green , int $blue , int $alpha..
PHP imagecolorset - 给指定调色板索引设定颜色 PHP 图像处理 imagecolorset — 给指定调色板索引设定颜色。 语法 void imagecolorset ( resource $image , int $index , int $red , int $green , int $blue ) 本函数将调色板中指定的索引设定为指定的颜色。对于在调色板图像中创建类似区域填充(flood-fill)的效果..
PHP imagecolorsforindex - 取得某索引的颜色 PHP 图像处理 imagecolorsforindex — 取得某索引的颜色。 语法 array imagecolorsforindex ( resource $image , int $index ) 本函数返回一个具有 red,green,blue 和 alpha 的键名的关联数组,包含了指定颜色索引的相应的值。 实例 以上实例的输出类似于: ..
PHP imagecolorstotal - 取得一幅图像的调色板中颜色的数目 PHP 图像处理 imagecolorstotal — 取得一幅图像的调色板中颜色的数目。 语法 int imagecolorstotal ( resource $image ) 本函数返回指定图像的调色板中的颜色数目。 相关文章 imagecolorat() 取得某像素的颜色索引值。 imagecolorsforindex() 取得某索引的颜..
PHP imagecolortransparent - 将某个颜色定义为透明色 PHP 图像处理 imagecolortransparent — 将某个颜色定义为透明色。 语法 int imagecolortransparent ( resource $image [, int $color ] ) imagecolortransparent() 将 image 图像中的透明色设定为 color。image 是 imagecrea..
PHP imagecreate - 新建一个基于调色板的图像 PHP 图像处理 imagecolorallocate — 新建一个基于调色板的图像。 语法 imagecreate ( int $x_size , int $y_size ) : resource imagecolorallocate() 返回一个图像标识符,代表了一幅大小为 x_size 和 y_size 的空白图像。 实例 PHP 图像处理..
PHP 获取图像宽度与高度PHP 图像处理 PHP 获取图像宽度函数:imagesx() imagesx() 函数用于获取图像的宽度,单位为像素,返回值为整型。 语法: int imagesx( resource image ) 参数 image 为如 imagecreatetruecolor()、imagecreatefromjpeg() 等函数返回的图像资源。 PHP 获取图像高度函数:imagesy() imagesy(..
PHP import_request_variables() 函数 PHP 可用的函数 import_request_variables() 函数将 GET/POST/Cookie 变量导入到全局作用域中。该函数在最新版本的 PHP 中已经不支持。 import_request_variables() 函数将 GET/POST/Cookie 变量导入到全局作用域中。如果你禁止了 register_globals,但又想用到一些全局..
PHP 包含文件 PHP include 和 require 语句 在 PHP 中,您可以在服务器执行 PHP 文件之前在该文件中插入一个文件的内容。 include 和 require 语句用于在执行流中插入写在其他文件中的有用的代码。 include 和 require 除了处理错误的方式不同之外,在其他方面都是相同的: require 生成一个致命错误(E_COMPILE_ERROR),在错误发生后脚本会停止执行。 inc..
PHP 安装 您需要做什么? 为了开始使用 PHP,您可以: 找一个支持 PHP 和 MySQL 的 Web 主机 在您自己的 PC 机上安装 Web 服务器,然后安装 PHP 和 MySQL 使用支持 PHP 的 Web 主机 如果您的服务器支持 PHP,那么您不需要做任何事情。 只要在您的 web 目录中创建 .php 文件即可,服务器将自动为您解析这些文件。 您不需要编译任何软件,或安装额外的工具。 由于 PH..
PHP intdiv() 函数 PHP 7 新特性 PHP 7 新增加了 intdiv() 函数,接收两个参数,返回值为第一个参数除于第二个参数的值并取整。 实例 [mycode type='php'] [/mycode] 以上程序执行输出结果为: 3 3 0 PHP 7 新特性..
PHP IntlChar() PHP 7 新特性 PHP 7 通过 intl 扩展来支持国际化 (i18n) 和本地化 (l10n) 。此扩展仅仅是对 ICU 库的基础包装,并提供了和 ICU 库类似的方法和特性。 PHP 7 通过新的 IntlChar 类暴露出 ICU 中的 Unicode 字符特性。这个类自身定义了许多静态方法用于操作多字符集的 unicode 字符。 实例 [mycode type='php..
PHP 简介 PHP 是服务器端脚本语言。 您应当具备的基础知识 在继续学习之前,您需要对以下知识有基本的了解: HTML CSS 如果您希望首先学习这些项目,请在我们的 首页 访问这些教程。 PHP 是什么? PHP(全称:PHP:Hypertext Preprocessor,即“PHP:超文本预处理器”)是一种通用开源脚本语言。 PHP 脚本在服务器上执行。 PHP 可免费下载使用。 PHP 对初学者而言简..
PHP intval() 函数 PHP 可用的函数 intval() 函数用于获取变量的整数值。 intval() 函数通过使用指定的进制 base 转换(默认是十进制),返回变量 var 的 integer 数值。 intval() 不能用于 object,否则会产生 E_NOTICE 错误并返回 1。 PHP 4, PHP 5, PHP 7 语法 int intval ( mixed $var [, int $base ..
PHP is_array() 函数 PHP 可用的函数 is_array() 函数用于检测变量是否是一个数组。 PHP 版本要求:PHP 4, PHP 5, PHP 7 语法 bool is_array ( mixed $var ) 参数说明: $var:要检测的变量。 返回值 如果检测的变量是数组,则返回 TRUE,否则返回 FALSE。 实例 实例 [mycode3 type='php..
PHP is_bool() 函数 PHP 可用的函数 is_bool() 函数用于检测变量是否是布尔型。 PHP 版本要求:PHP 4, PHP 5, PHP 7 语法 bool is_bool ( mixed $var ) 参数说明: $var:要检测的变量。 返回值 如果 var 是 boolean 则返回 TRUE。 实例 实例 [mycode3 type='php'] [/my..
PHP is_callable() 函数 PHP 可用的函数 is_callable() 函数用于检测函数在当前环境中是否可调用。 is_callable() 函数验证变量的内容能否作为函数调用。 这可以检查包含有效函数名的变量,或者一个数组,包含了正确编码的对象以及函数名。 PHP 版本要求:PHP 4 >= 4.0.6, PHP 5, PHP 7 语法 bool is_callable ( callable $name..
PHP is_float()、 is_double()、is_real()函数 PHP 可用的函数 is_float() 函数用于检测变量是否是浮点型。 别名函数:is_double(),is_real()。 注意: 若想测试一个变量是否是数字或数字字符串(如表单输入,它们通常为字符串),必须使用 is_numeric()。 PHP 版本要求:PHP 4, PHP 5, PHP 7 语法 bool is_float ( mixe..
PHP is_int() 、is_integer()、is_long() 函数 PHP 可用的函数 is_int() 函数用于检测变量是否是整数。 注意: 若想测试一个变量是否是数字或数字字符串(如表单输入,它们通常为字符串),必须使用 is_numeric()。 别名函数():is_integer()、is_long() 。 PHP 版本要求:PHP 4, PHP 5, PHP 7 语法 bool is_int ( mixed..