Learning Path
浏览 PHP 相关教程与章节。
PHP、Node.js、Java Web、Python Web 框架、API 与服务端开发。
教程
844
PHP get_defined_vars() 函数 PHP 可用的函数 get_defined_vars() 函数返回由所有已定义变量所组成的数组。 版本要求:PHP 4 >= 4.0.4, PHP 5, PHP 7 语法 array get_defined_vars ( void ) 参数说明: void。 返回值 返回一个包含所有已定义变量列表的多维数组,这些变量包括环境变量、服务器变量和用户定义的变量。..
PHP get_resource_type() 函数 PHP 可用的函数 get_resource_type() 返回资源(resource)类型。 版本要求:PHP 4 >= 4.0.2, PHP 5, PHP 7 语法 string get_resource_type ( resource $handle ) 参数说明: $handle:句柄。 返回值 此函数返回一个字符串,用于表示传递给它的 resou..
php getimagesize 函数 - 获取图像信息 PHP 图像处理 getimagesize() 函数用于获取图像大小及相关信息,成功返回一个数组,失败则返回 FALSE 并产生一条 E_WARNING 级的错误信息。 语法格式: array getimagesize ( string $filename [, array &$imageinfo ] ) getimagesize() 函数将测定任何 GIF,JPG,P..
PHP getimagesizefromstring - 获取图片信息函数PHP 图像处理 getimagesizefromstring — 从字符串中获取图像尺寸信息。 语法 array getimagesizefromstring ( string $imagedata [, array &$imageinfo ] ) 同 getimagesize() 函数。 区别是 getimagesizefromstring() ..
PHP gettype() 函数 PHP 可用的函数 gettype() 函数用于获取变量的类型。 注意:不要使用 gettype() 来测试某种类型,因为其返回的字符串在未来的版本中可能需要改变。此外,由于包含了字符串的比较,它的运行也是较慢的。使用 is_* 函数代替。 版本要求:PHP 4, PHP 5, PHP 7 语法 string gettype ( mixed $var ) 参数说明: $var:变量。 ..
PHP If...Else 语句 条件语句用于根据不同条件执行不同动作。 PHP 条件语句 当您编写代码时,您常常需要为不同的判断执行不同的动作。您可以在代码中使用条件语句来完成此任务。 在 PHP 中,提供了下列条件语句: if 语句 - 在条件成立时执行代码 if...else 语句 - 在条件成立时执行一块代码,条件不成立时执行另一块代码 if...elseif....else 语句 - 在若干条件之一成立时执..
PHP 图像处理 PHP 提供了丰富的图像处理函数,主要包括: 函数描述 gd_info() 取得当前安装的 GD 库的信息 getimagesize() 获取图像信息 getimagesizefromstring() 获取图像信息 image_type_to_extension() 获取图片后缀 image_type_to_mime_type() 返回图像的 MIME 类型 image2wbmp() 输出WBMP图片 ima..
PHP image_type_to_extension - 获取图片后缀PHP 图像处理 image_type_to_extension — 根据指定的图像类型返回对应的后缀名。 语法 string image_type_to_extension ( int $imagetype [, bool $include_dot = TRUE ] ) 根据给定的常量 IMAGETYPE_XXX 返回后缀名。 实例 执行以上文件会在..
PHP image_type_to_mime_type - 返回图像的 MIME 类型 PHP 图像处理 image2wbmp — 取得 getimagesize,exif_read_data,exif_thumbnail,exif_imagetype 所返回的图像类型的 MIME 类型。 语法 string image_type_to_mime_type ( int $imagetype ) image_type_to_mime..
PHP image2wbmp - 输出WBMP图片 PHP 图像处理 image2wbmp — 以 WBMP 格式将图像输出到浏览器或文件。 语法 int image2wbmp ( resource $image [, string $filename [, int $threshold ]] ) image2wbmp() 从 image 图像创建一个名为 filename 的 WBMP 文件。image 参数是某个创建图像函数的..
PHP imageaffine - 返回经过仿射变换后的图像 PHP 图像处理 imageaffine — 返回经过仿射变换后的图像,剪切区域可选。 语法 resource imageaffine ( resource $image , array $affine [, array $clip ] ) 参数 image 由图象创建函数(例如imagecreatetruecolor())返回的图象资源。 affine 数组,其中..
PHP imageaffinematrixconcat - 连接两个矩阵 PHP 图像处理 imageaffinematrixconcat — 连接两个矩阵。 语法 array imageaffinematrixconcat ( array $m1 , array $m2 ) 参数 m1 数组,其中键为 0 至 5 的数字。 m2 数组,其中键为 0 至 5 的数字。 返回值 成功则返回数组(其中键为 0 至 5 的数字..
PHP imageaffinematrixget - 获取矩阵 PHP 图像处理 imageaffinematrixget — 获取矩阵。 语法 array imageaffinematrixget ( int $type [, mixed $options ] ) 参数 type IMG_AFFINE_* 常量。 options 返回值 成功则返回数组(其中键为 0 至 5 的数字)和浮点值,或者在失败时返回 FAL..
PHP imagealphablending - 设定图像的混色模式 PHP 图像处理 imagealphablending — 设定图像的混色模式。 语法 bool imagealphablending ( resource $image , bool $blendmode ) imagealphablending() 允许在真彩色图像上使用两种不同的绘画模式。 在混色(blending)模式下,alpha 通道色彩成分提供给所..
PHP imageantialias - 是否使用抗锯齿(antialias)功能 PHP 图像处理 imageantialias — 是否使用抗锯齿(antialias)功能。 语法 bool imageantialias ( resource $image , bool $enabled ) 对线段和多边形启用快速画图抗锯齿方法。不支持 alpha 部分。使用直接混色操作。仅用于真彩色图像。 不支持线宽和风格。 使用抗..
PHP imagearc - 画椭圆弧 PHP 图像处理 imagearc — 用于画椭圆弧。 语法 bool imagearc ( resource $image , int $cx , int $cy , int $w , int $h , int $s , int $e , int $color ) imagearc() 以 cx,cy(图像左上角为 0, 0)为中心在 image 所代表的图像中画一个椭圆弧。w 和 h ..
PHP imagechar - 写出横向字符 PHP 图像处理 imagechar — 写出横向的字符。 语法 bool imagechar ( resource $image , int $font , int $x , int $y , string $c , int $color ) imagechar() 将字符串 c 的第一个字符画在 image 指定的图像中,其左上角位于 x,y(图像左上角为 0, 0),颜色为 c..
PHP imagecharup - 垂直地画一个字符 PHP 图像处理 imagecharup — 垂直地画一个字符。 语法 bool imagecharup ( resource $image , int $font , int $x , int $y , string $c , int $color ) imagecharup() 将字符 c 垂直地画在 image 指定的图像上,位于 x,y(图像左上角为 0, 0),颜色..
PHP imagecolorallocate - 为一幅图像分配颜色 PHP 图像处理 imagecolorallocate — 为一幅图像分配颜色。 语法 int imagecolorallocate ( resource $image , int $red , int $green , int $blue ) imagecolorallocate() 返回一个标识符,代表了由给定的 RGB 成分组成的颜色。red,green..
PHP imagecolorallocatealpha - 为一幅图像分配颜色和透明度 PHP 图像处理 imagecolorallocatealpha — 为一幅图像分配颜色和透明度。 语法 int imagecolorallocatealpha ( resource $image , int $red , int $green , int $blue , int $alpha ) imagecolorallocatealpha..
PHP imagecolorat - 取得某像素的颜色索引值 PHP 图像处理 imagecolorat — 取得某像素的颜色索引值。 语法 int imagecolorat ( resource $image , int $x , int $y ) 返回 image 所指定的图形中指定位置像素的颜色索引值。 如果 PHP 编译时加上了 GD 库 2.0 或更高的版本并且图像是真彩色图像,则本函数以整数返回该点的 RGB 值。用移..
PHP imagecolorclosest - 取得与指定的颜色最接近的颜色的索引值 PHP 图像处理 imagecolorclosest — 取得与指定的颜色最接近的颜色的索引值。 语法 int imagecolorclosest ( resource $image , int $red , int $green , int $blue ) 返回图像调色板中与指定的 RGB 值最“接近”的颜色。 指定的颜色与调色板中的每个颜色的..
PHP imagecolorclosestalpha - 取得与指定的颜色加透明度最接近的颜色的索引 PHP 图像处理 imagecolorclosestalpha — 取得与指定的颜色加透明度最接近的颜色的索引。 语法 int imagecolorclosestalpha ( resource $image , int $red , int $green , int $blue , int $alpha ) 返回图像调色板中与指..
PHP imagecolorclosesthwb - 取得与指定的颜色最接近的色度的黑白色的索引 PHP 图像处理 imagecolorclosesthwb — 取得与指定的颜色最接近的色度的黑白色的索引。 语法 int imagecolorclosesthwb ( resource $image , int $red , int $green , int $blue ) 取得与给定颜色最接近的色度的黑白色的索引。 注意:此函数需..