php(一)

來源:互聯網
上載者:User

標籤: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);

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.