php基礎教程——學習小結

來源:互聯網
上載者:User
php基礎教程——學習總結

一、php和表單

1.POST方法手動發送資料:

二者部分區別:

GET:

1.將資訊聚集起來作為URL一部分傳送

2.傳送數量有限

3.公開傳送,諸如密碼資訊會暴露

4.建立的表單可以添加為書籤。

POST:

1.傳遞的資訊使用者看不到


用法樣本:

html檔案:ws.html

    test  
php檔案:handle.php

    test  
print "

hello $title $name";?>

輸入:myname

結果:hello Mr myname

2.GET傳送資料

    test 
  • Charles

php檔案:handle.php

    test  
  


二、相關函數學習

1.格式化數值:

round(要格式化的數字 , 保留小數點位元);

eg:$test=5.555555555; round(test, 2); // 5.55

number_format(數字, 小數點位元, 代替小數點的符號, 千位分隔字元)

eg:number_format("10000000", 2 ,"," ,".");// 10.000.000,00

2.隨機函數rand()

eg:rand(0, 100);//產生0-100 隨機一個數


  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.