php_one

array_shift(使得第一个参数和后面的参数分开,先进先出)
vsprintf格式化sql语句
$r =
substr($sql,0,6)从0个开始截取6位。这种写法在php5.4之前是不支持的
strcasecmp(a,b);如果a=b就返回0,如果第一个大于第二个就返回1,否则返回-1
array_push(gog,pig);在数组里插入两个
global在函数中引用全局变量

定义常量 defind("HOST","127.0.0.1"); defind("USER","root"); defind("PWD","root");
globla $conn; //如果想自定义背景颜色,用到imagefill函数 $bg =
imagecolorallocate($im,200,200,200); imagefill($im,0,0,$bg);
//第二次调用这个方法,是可以生成图片上面的文字或其他样式的颜色 $te =
imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255)); $te2 =
imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255)); //生成干扰线,就是画线
$posLineX1 = rand(6,30); $posLineX2 = rand(30,60); for($i=0;$i<5;$i++){
    $posLinY1=rand(2,10);    
$posLinY2=rand(11,28);    
imageline($im,$posLineX1,$posLinY1,$posLineX2,$posLinY2,$te2);
    $posLineX1 += rand(30,60);     $posLineX2 +=
rand(61,98); }

for($i=0;$i<90;$i++){     $te3 =
imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255));    
imagesetpixel($im,rand(2,100),rand(2,30),$te3); }

把数组分割成字符串 implode       $s1 =
implode(",",$str2); 把字符串分割成数组 explode       $s2 =
explode("-",$str1);

时间: 2024-08-01 18:45:51

php_one的相关文章

MySQL(5):表的crud

表名的前缀: 两个student表,为了区分相同逻辑表名的不同应用,给逻辑表名,增加前缀 //学生管理 create table info_student ( name varchar(20), stu_no varchar(20) ); //在线考试 create table exam_student ( name varchar(20), stu_no varchar(20), score int ); 1.有哪些表? show tables; 2. show tables [like 'p