学习PHP时的一些总结(三)

本文详细介绍了如何在PHP中设置默认时区,并深入探讨了GD库的各种图形绘制函数,包括设置像素、绘制线条、矩形、多边形、椭圆等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

字符串的处理与正则表达式:

 

 

PHP中更改默认的时区:

1)更改配置文件中的参数  date.timezone=Etc/GMT-8

2)在PHP脚本中设置默认的时区   date_default_timezone_set("PRC");

 

GD库函数

imagesetpixel(resource $image,int $x, int $y,int $color);  设置某一个点的颜色

imageline(resource $image,int $x, int $y,int $color); 画线

imagerectangle(resource $image,int $x,int $y,int $x2,int $y2,int $color) 画矩形

imagefilledrectangle(resource $image,int $x,int $y,int $x2,  int $y2, int $color) 画填充的矩形。

imagepolygon(resource $image, array $points,int $num_points, int $color)画多边形。

imagefilledpolygon(resource $image,array $points, int $num_points, int $color) 填充多边形

imageellipse(resource $image,int $cx,int $cy, int $w,int $h, int $color) 画一个椭圆

imagefilledellipse(resource $image,int $cx, int $cy,int $w, int $h, int $color)  填充一个椭圆

imagearc(resource $image, int $cx, int $cy, int $w, int $h, int $s, int $e, int $color) 画弧线

imagefilledarc(resource $image,int $cx, int $cy, int $w, int $h, int $s, int $e, int $color)填充弧线

imagestring(resource $image, int $font, int $x, int $y, string $s, int color) 画一行字符串

imagestringup(resurce $imae, int $font, int $x, int $y, string $s, int $color) 垂直画一个字符串

imagechar(resource $image, int $font, int $x, int $y, char $c, int $color)  水平画一个字符

imagecharup(resource $image, int $font, int $x, int $y, char $c, int $color)垂直画一个字符

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值