<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>PHP on Archai&#39;s home</title>
    <link>https://blog.archai.space/tags/php/</link>
    <description>Recent content in PHP on Archai&#39;s home</description>
    <generator>Hugo -- gohugo.io</generator>
    <lastBuildDate>Wed, 14 Oct 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.archai.space/tags/php/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>PHP语法小结</title>
      <link>https://blog.archai.space/p/php%E8%AF%AD%E6%B3%95%E5%B0%8F%E7%BB%93/</link>
      <pubDate>Wed, 14 Oct 2020 00:00:00 +0000</pubDate>
      
      <guid>https://blog.archai.space/p/php%E8%AF%AD%E6%B3%95%E5%B0%8F%E7%BB%93/</guid>
      <description>基本语法 输出语句    语句 功能     echo 输出字符串类型   print_r 输出引用类型(对象,数组等)   var_dunp 检测变量类型    ::: tip echo语句可用于给前端返回响应体。比如前端通过ajax请求，可以在xhr.response中直接得到echo的内容 :::
变量&amp;amp;常量 👉🏼 变量
   语句 功能 返回值     isset() 检测变量是否存在 boolean   unset() 删除某个变量 none    👉🏼 常量
常量用const 或 define 定义，常量名一般全部大写，不受作用域的限制
::: tip
一般是define在类外定义常量，const在类内定义常量，并且const必须通过类名::变量名来进行访问。但是php5.3以上支持类外通过const定义常量。
:::
:::danger
const不能在条件语句中使用，必出错
:::
 参考文章 《PHP中define() 与 const定义常量的区别详解》</description>
    </item>
    
    <item>
      <title>PHP开发验证码类</title>
      <link>https://blog.archai.space/p/php%E5%BC%80%E5%8F%91%E9%AA%8C%E8%AF%81%E7%A0%81%E7%B1%BB/</link>
      <pubDate>Sat, 03 Oct 2020 00:00:00 +0000</pubDate>
      
      <guid>https://blog.archai.space/p/php%E5%BC%80%E5%8F%91%E9%AA%8C%E8%AF%81%E7%A0%81%E7%B1%BB/</guid>
      <description>利用php中的GD库可以完成验证码类的开发。后盾人教程
 PHP创建图像步骤 发送HTTP头信息，声明内容为图像 header(&amp;#39;Content-type:image/gif&amp;#39;); header(&amp;#39;Content-type:image/jpeg&amp;#39;); header(&amp;#39;Content-type:image/png&amp;#39;); 通过设置头信息让浏览器渲染出图像，而不是HTML等其他类型
创建画布 imageCreateTrueColor(width,height); width &amp;amp; height 画布宽高，即为输出图片的尺寸,返回为source 类型，后续操作都是针对这个资源展开。
创建绘图所需要的颜色 imageColorAllocate(img_resource,R,G,B); 颜色从属于创建画布产生的图像资源而存在，后面三个值分别为红绿蓝三个通道的值，为int类型,在0—255之间。
绘图（填充画布、画圆、画方块、画线条、画布上写字） 👉 填充画布(画布背景)
imageFill(img_resource,x,y,color); 👉 画圆
//绘制空心圆形 imageEllipse(img_res,x,y,w,h,color); //绘制填充好的实心圆 imageFilledEllipse(img_res,x,y,w,h,color); 绘制 圆心(x,y) 宽 x，高 h，的圆
👉 画方
//空心矩形 imageRectangle(img_res,x1,y1,x2,y2,color); //实心矩形 imageFilledRectangle (img_res,x1,y1,x2,y2,color); (x1,y1)为左上角坐标， (x2,y2)为右下角坐标

👉画线条
imageLine(img_res,x1,y1,x2,y2,color) (x1,y1)与(x2,y2)两点确定的直线。
👉 绘制像素(点)
imagesetpixel ( img_res , x , y , color ) 👉 输入文本
imagettftext (img_res , size , angle , x , y , color , fontfile ,text ) 图像资源，字体尺寸，角度，第一个字符的基本点（大概是字符的左下角），Y 坐标（字体基线的位置），颜色 ，字体文件绝对路径(realpath($path)获取)，文本字符串（UTF-8 编码）</description>
    </item>
    
  </channel>
</rss>
