天空是藍(lán)色的

          做好軟件為中國(guó) #gcc -c helloworld.c -o helloworld.o //編譯目標(biāo)文件 #gcc helloworld.o -o helloworld //編譯成可執(zhí)行exe #helloworld //運(yùn)行exe
          數(shù)據(jù)加載中……
          記兩個(gè)PHP函數(shù)

          fileicq81.gif

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

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

          正則表達(dá)式查找替換
          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 閱讀(427) 評(píng)論(0)  編輯  收藏 所屬分類: PHP

          主站蜘蛛池模板: 本溪市| 昆山市| 安吉县| 文水县| 孝义市| 马龙县| 芦溪县| 镇巴县| 顺义区| 秭归县| 新晃| 分宜县| 桦南县| 响水县| 金寨县| 沅江市| 六安市| 和林格尔县| 马鞍山市| 鄂尔多斯市| 遵化市| 武冈市| 鹰潭市| 麻栗坡县| 行唐县| 垫江县| 海安县| 钟祥市| 石嘴山市| 南雄市| 容城县| 拉孜县| 遂川县| 昌吉市| 扬州市| 饶河县| 邳州市| 万安县| 孙吴县| 法库县| 东丽区|