找到 1050 篇文章 关于 PHP

如何在 PHP MySQL 中从时间戳中提取日期/月份/年份?

Samual Sam
更新于 2019-07-30 22:30:24

792 次浏览

要从时间戳中提取日期/月份/年份,您需要使用 date_parse() 函数。语法如下:print_r(date_parse(“anyTimeStampValue”));PHP 代码如下:$yourTimeStampValue="2019-02-04 12:56:50"; print_r(date_parse($yourTimeStampValue));PHP 代码快照如下:以下输出:Array ( [year] => 2019 [month] => 2 [day] => 4 [hour] => 12 [minute] => 56 [second] => 50 [fraction] => 0 [warning_count] => 0 [warnings] => Array ( ) [error_count] => 0 [errors] => Array ( ) [is_localtime] => )示例输出快照:

如何使用 PHPMyAdmin 在 MySQL 数据库中指定小数精度和小数位数?

Chandu yadav
更新于 2019-07-30 22:30:24

2K+ 次浏览

创建表时,您需要选择一个数据库。现在,我有一个示例数据库。快照如下:现在您需要给出表名以及您想要的列数:之后您需要按下 Go 按钮。现在,以下部分将可见:DECIMAL 需要两个参数,即数字的总位数和第二个参数是小数点后的位数。DECIMAL 的结构如下:DECIMAL(X, Y)这里,X 是总位数,Y 是小数点后的位数。让我们看一个例子:DECIMAL(6, 4)上面,我们将有 6 位数字和小数点后 2 位数字。对于 ... 阅读更多

PHP 中的 imagecreatetruecolor() 函数

Arjun Thakur
更新于 2019-12-31 08:05:48

765 次浏览

imagecreatetruecolor() 函数创建一个新的真彩色图像。语法imagecreatetruecolor (width , height )参数width:图像宽度。height:图像高度。返回值imagecreatetruecolor() 函数在成功时返回图像资源标识符,在错误时返回 FALSE。示例以下是一个示例 Live Demo输出以下输出显示新图像的高度和宽度:500 600示例让我们看另一个具有不同高度和宽度的示例: Live Demo输出以下输出显示新图像的高度和宽度:450 300

PHP 中的 imageconvolution() 函数

Chandu yadav
更新于 2019-12-31 08:00:58

98 次浏览

imageconvolution() 函数语法bool imageconvolution (img, matrix, div, offset )参数img:使用 imagecreatetruecolor() 函数创建图像。matrix:3x3 矩阵是一个包含三个浮点数数组的数组。div:卷积结果的除数,用于归一化。offset:颜色偏移量。返回值imageconvolution() 函数在成功时返回 True,失败时返回 False。示例以下是一个示例输出以下输出示例让我们看另一个使用相同图像的不同参数值的示例。您现在可以轻松地发现差异:输出以下输出

PHP 中的 imagecolormatch() 函数

Ankith Reddy
更新于 2019-12-31 07:59:35

46 次浏览

imagecolormatch() 函数使图像的调色板版本的颜色更接近真彩色版本语法bool imagecolormatch ( img1, img2 )参数img1:使用 imagecreatetruecolor() 函数创建图像。img2:指向图像的调色板图像链接资源。此图像与 img1 大小相同。返回值imagecolormatch() 函数在成功时返回 TRUE,失败时返回 FALSE。示例以下是一个示例 Live Demo输出以下输出:1示例让我们看另一个示例 Live Demo输出以下输出:1

PHP 中的 imagecolortransparent() 函数

George John
更新于 2019-12-31 07:58:19

286 次浏览

imagecolortransparent() 函数用于设置透明图像的颜色。语法imagecolortransparent ( img, color )参数img:使用 imagecreatetruecolor() 函数创建图像。color:使用 imagecolorallocate() 创建的颜色标识符。返回值imagecolortransparent() 函数返回新透明颜色的标识符。如果未指定颜色并且图像没有透明颜色,则返回值为 -1。示例以下是一个示例输出以下输出

PHP 中的 imagecolorresolve() 函数

Arjun Thakur
更新于 2019-12-31 07:48:35

20 次浏览

imagecolorresolve() 函数获取指定颜色的索引或其最接近的可能替代方案。语法imagecolorresolve (img , red , green , blue )参数img:使用 imagecreatetruecolor() 函数创建的图像。red:红色分量的值。green:绿色分量的值。blue:蓝色分量的值。返回值imagecolorresolve() 函数返回颜色索引。示例以下是一个示例 Live Demo输出以下输出:Array ( [0] => 128 [1] => 129 [2] => 130 )

PHP 中的 imagecolorstotal() 函数

Chandu yadav
更新于 2019-12-31 07:47:13

43 次浏览

imagecolorstotal() 函数获取图像调色板中颜色的数量语法imagecolorstotal (img)参数img:使用 imagecreatetruecolor() 创建的图像。返回值imagecolorstotal() 函数返回图像调色板中颜色的数量。示例以下是一个示例 Live Demo输出以下输出:颜色数 = 128

PHP 中的 imagecolorset() 函数

Ankith Reddy
更新于 2019-12-31 07:46:41

93 次浏览

imagecolorset() 函数为指定的调色板索引设置颜色。使用它可以在调色板图像中创建类似于填充的效果。语法imagecolorset ( img, index, red, green, blue, alpha )参数img:使用 imagecreatetruecolor() 函数创建的图像index:调色板中的索引imagered:红色分量的值green:绿色分量的值blue:蓝色分量的值alpha:图像的透明度。返回值imagecolorset() 函数不返回任何内容。示例以下是一个示例输出以下输出

PHP 中的 imagecolorsforindex() 函数

George John
更新于 2019-12-31 07:46:17

67 次浏览

imagecolorsforindex() 函数获取索引的颜色。语法imagecolorsforindex ( img, index )参数img:使用 imagecreatetruecolor() 创建图像Index:设置颜色索引。返回值imagecolorsforindex() 函数返回一个关联数组,其中包含 red、green、blue 和 alpha 键,这些键包含指定颜色索引的相应值。示例以下是一个示例 Live Demo输出以下输出:array(4) { ["red"]=> int(255) ["green"]=> int(255) ["blue"]=> int(255) ["alpha"]=> int(127) }

广告

© . All rights reserved.