天空是藍色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
          數據加載中……
          記兩個PHP函數

          fileicq81.gif

          http://cn.php.net/manual/zh/function.file.php

          <?php
          // 將一個文件讀入數組。本例中通過 HTTP 從 URL 中取得 HTML 源文件。
          $lines 
          = file('http://www.example.com/');
          // 在數組中循環,顯示 HTML 的源文件并加上行號。
          foreach ($lines as $line_num 
          => $line) {
             echo 
          "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
          }
          // 另一個例子將 web 頁面讀入字符串。參見 file_get_contents()。
          $html 
          = implode('', file ('http://www.example.com/'));
          ?> 

          正則表達式查找替換
          http://cn.php.net/manual/zh/function.preg-replace.php

          <?php
          $string 
          = "April 15, 2003";
          $pattern = "/(\w+) (\d+), (\d+)/i";
          $replacement = "\${1}1,\$3";
          print preg_replace($pattern, $replacement, $string);

          /* Output
             
          ======

          April1
          ,2003

           */
          ?> 

          posted on 2005-12-27 22:45 bluesky 閱讀(425) 評論(0)  編輯  收藏 所屬分類: PHP

          主站蜘蛛池模板: 从化市| 卓尼县| 江阴市| 黔西| 镇安县| 平安县| 昆山市| 阿坝县| 防城港市| 中西区| 墨玉县| 青河县| 南郑县| 盐津县| 康平县| 钟祥市| 墨脱县| 浦北县| 南部县| 双桥区| 中阳县| 张掖市| 栖霞市| 赞皇县| 南漳县| 南开区| 城口县| 丰原市| 西峡县| 平罗县| 福建省| 武宣县| 留坝县| 喀喇| 安图县| 正蓝旗| 铜山县| 龙海市| 漳州市| 三亚市| 堆龙德庆县|