標籤:c color int a set line
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);