Install
- PHP/Install
~/bin/Linux/Install.sh PHP/Install
関数とか
- array_shift(配列のカレントインデックスとシフト)
- count(配列サイズ)
- explode(文字列分割)
- ファイル操作
- list(配列の代入)
- オブジェクト
- var_dump(オブジェクトダンプ)
- Cookie
- Link:PHP+include
条件判定
- 配列にはいっているか? : in_array
<?PHP $x='3'; if ( in_array($x,array('1','2','3'))) echo "found"; ?>
文字列
- 置換
- 連結
コレクション
- 配列
- 連想配列
- associative array
- "while , each"
- 配列、オブジェクトはキーにできません! => Warning: Illegal offset type
例外処理
- 標準入力
- Exception : PHP: staticメソッドと思って呼んでしまうとE_STRICTが出てそれをcatchできない。
- finallyはない。(少なくともPHP5)
ファイルI/O
永続化
タイプ
正規表現
XML
環境
- レンダリングをバッファリングする(ob_star/ob_clear)
- index.phpが表示されない
- php:Console_CommandLineでコマンドライン引数を処理
- 定義済み関数一覧
echo "<?php print_r(get_defined_functions()); ?>" | php | grep math
セキュリティ
データベース
- count(*) の結果を db_resultに通す。
$cnt_msg = db_result( db_query("select count(*) from privatemsg where recipient= ".$user->uid. " and recipient_del = 0")); - PDO
- Doctrine
Timeout問題
- php.ini
- max_execution_time
- max_input_time
- set_time_limit関数
- apacheのタイムアウト設定
Debug / Test
- syslog
- var_dump
- assert
