http://spcedu.tkblind.tku.edu.tw/~peterpan/php4/funcindex.php.htm   函數表

http://www.im.ncnu.edu.tw/ycchen/www2010/4ArrFunc.ppt#319,1,PHP 5 陣列與自定函數

t3893527f 發表在 痞客邦 留言(0) 人氣()

一、先下載圖片和csv檔放在C:\AppServ\www\0507裡,解壓縮


二、程式設計的步驟:
   1讀取csv檔
   2 設計表單,顯示產品資訊
   3 統計資訊
  4 顯示統計結果,回應客戶

三、程式撰寫:

  <?php
    setlocale(LC_ALL,"zh-TW.UTF-8");  // 設定語系為台灣,UTF-8編碼
    //fopen(filename,mode,include_path,context)
    $row = 0;
    $file = fopen("item.csv","r");
    // 開始讀取資料,如果可以讀取的話
    while(($data = fgetcsv($file,1000,","))!==false){
        $num = count($data);
        if($row != 0){
            for($i=0;$i<=$num;$i++){
                // mb_convert_encoding(字串,UTF-8,big5)
                $tmp[$i] = mb_convert_encoding($data[$i],"utf-8","big5");
                // 把 $data 中big5編碼的文字轉換成 utf8 之後 儲存在 $tmp
                echo $tmp[$i];
            }
        }
        $row++;
    }
     
     
?>

t3893527f 發表在 痞客邦 留言(0) 人氣()

<form>

    姓名 : <input type='text' name='user_name'><p/>
    電話 : <input type='text' name='user_phone'><p/>
    <input type='submit' name='send' value='確定送出'>
 
</form>

t3893527f 發表在 痞客邦 留言(0) 人氣()

?php

    $a =2;
     
      for($i=1;$i<=9;$i++){
    
     echo $a." * ".$i." = ".$a*$i."<br/>";
    
     }

?>

t3893527f 發表在 痞客邦 留言(0) 人氣()

<html>
 <head>
  <meta http-equiv='Content-Type' content='text/html;charset=utf-8' />
  <title>上課第三天</title>
 </head>
 <body>
  <!-- 課堂學員自行操作練習題目 -->
  <div align='center'>
  據日本內閣府指出,<b>在未來3個會計年度內,</b>
  <i>包括坍塌或受損房屋、</i>工廠,以及道路與橋<font color='blue'>樑等基礎設施的全部</font>重建費用,
  估計在<u><font color='blue'>16兆至25兆</font></u>日圓之間。
  </div>
  <!-- 課堂學員自行操作練習題目 -->
  
  <a href='http://www.google.com.tw' target='_blank'>前往 Google </a>
  <!-- 設定一個使用另開新視窗的方式,超連結到 Google 站。注意 http:// 不能省略 -->
  
  <a href='mailto:stephen@mail.com?subject=Hello!' style='text-decoration:none'>mail for me</a>
  <!-- 設定一個電子郵件的超連結,並設定收件人為stephen@mail.com,主旨為 Hello!   style='text-decoration:none 可以讓超連結不帶底線 -->
  
  <a href='mailto:stephen@mail.com'><img src='img/mail.jpg'></a>
  <!-- 設定一張圖片作為超連結 -->
  
  <hr></hr>
  <!-- 項目清單標籤練習 -->
  <!-- 項目符號 -->
  我的專長:
  <ul type='disc'>  <!-- 黑色點 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ul>
  
  <ul type='circle'>  <!-- 中空圓 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ul>
  <ul type='square'>  <!-- 方塊 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ul>
  
  <p/>
  <!-- 項目編號 -->
  我的專長:
  <ol start='3'>   <!-- 利用 start 屬性,讓編號從 3 開始 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ol>
  
  <ol type='A'>  <!-- 用 A B C ... 編號 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ol>
  
  <ol type='a'>  <!-- 用 a b c ... 編號 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ol>
  
  <ol type='I'>  <!-- 用 I II III... 編號 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ol>
  
  <ol type='i'>  <!-- 用 i ii iii ... 編號 -->
   <li>打電腦</li>
   <li>打人</li>
   <li>打小孩</li>
  </ol>
  
 </body>
</html>

t3893527f 發表在 痞客邦 留言(0) 人氣()

html>
 <head>
  <meta http-equiv='Content-Type' content='text/html;charset=utf-8' />
  <title>上課第三天</title>
 </head>
 <body>
  <a href='http://www.google.com.tw' target='_blank'>Google</a>
 </body>
</html>

t3893527f 發表在 痞客邦 留言(0) 人氣()

<HTML> <!--step 1-->
 <HEAD> <!--step 2-->
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  <title>Esky</title>  <!--step 4-->
  
 </HEAD> <!--step 4-->
 <BODY> <!--step 3-->
  <div align='center'><font color='red' size='9'> 大家好!</font><!--step5-->
  <hr> </hr>
  〔自由時報記者施曉光、彭顯鈞、曾韋禎/台北報導〕<br>
  因應馬總統補提名四位大法官,<p/>
  立法院國民黨團將在總統咨文送達立法院後,...(詳全文)</div>
 </BODY> <!--step 3-->
</HTML> <!--step 1-->

t3893527f 發表在 痞客邦 留言(0) 人氣()

<HTML> <!--step 1-->
 <HEAD> <!--step 2-->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Esky</title>  <!--step 4-->
  
 </HEAD> <!--step 4-->
 <BODY> <!--step 3-->
  大家好!
 </BODY> <!--step 3-->
</HTML> <!--step 1-->

t3893527f 發表在 痞客邦 留言(0) 人氣()

<html>  <!--step 1-->
 <head>  <!--step 2-->
  <title>Ya! 我的第一個網頁</title>   <!--step 4-->
 </head>  <!--/step 2-->
 <body>  <!--step 3-->
  Hello, World!! 大家好!! <!--step 5-->
 </body>  <!--/step 3-->
</html>  <!--/step 1-->

t3893527f 發表在 痞客邦 留言(0) 人氣()