安裝中文環境準備:
1.到官網下載最新 Joomla 主程式(本教學文章版本為1.5.15) 解壓縮至 Joomla 目錄
2.中文語系官網下載中文化檔案。
zh-TW.site.1.5.15.zip解壓縮至 Joomla/language/zh-TW/
zh-TW.administrator.1.5.15.zip解壓縮至 Joomla/administrato/language/zh-TW/
接下來上傳至你的主機,上傳完成後開始執行 http://你的網站/安裝目錄






在 PHP 版本 5.0.0 之前 file_put_contents 這個函數,必須使用fwrite寫法。
1
2
3
4
5
6
| <?php
$fp = fopen("data.txt","w"); //必須要先用fopen開啟文件
$string = "Hello World"; //字串
fwrite($fp, $string); //用fwrite寫入
fclose($fp); //關閉檔案
?> |
使用
file_put_contents
1
2
3
4
5
| <?php
$fp="data.txt";
$string = "Hello World"; //字串
file_put_contents($fp, $string);
?> |
fwrite 寫入文件未端,只要把
$mode 參數 w 改成 a 就好。
1
2
3
4
5
6
| <?php
$fp = fopen("data.txt","a"); //必須要先用fopen開啟文件
$string = "Hello World"; //字串
fwrite($fp, $string); //用fwrite寫入
fclose($fp); //關閉檔案
?> |
由於
file_put_contents 沒有
$mode 參數可以設定,所以需要使用
file_get_contents 取得文件內容。
PHP 5.3 新增的一個 goto 程式碼。
GOTO 也不是完全好用,詳見 wili 對於goto使用的批評
在 PHP 中 GOTO 限制不能跳進迴圈或switch 中。
1
2
3
4
5
6
7
8
9
| <?php
goto loop;
for($i=0,$j=50; $i<100; $i++) {
while($j--) {
loop:
}
}
echo "$i = $i";
?> |

php goto
每次想密碼很麻煩,後來就乾脆自己寫一段,實際上強式密碼我也不常用所以沒加入產生。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| <?php
//亂數密碼產生器
function generatorPassword($pt=8,$myWord=""){
$password="";
$str="0123456789abcdefghijklmnopqrstuvwxyz";
$str.=$myWord;
$str_len=strlen($str);
for ($i=1;$i<=$pt;$i++){
$rg=rand()%$str_len;
$password.=$str{$rg};
}
return $password;
}
//避開強式密碼 < 在html消失
//header("Content-Type: text;");
echo generatorPassword();
/*
預設八個字元,設定10個字元
generatorPassword(10,<);
*/
?> |
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!