PHP

サンプルコード

function getIpAddress() { return (empty($_SERVER)?(empty($_SERVER)? $_SERVER:$_SERVER):$_SERVER);}

PHP

操作コマンド

# yum search uuid
# yum install libuuid-devel
# pecl install uuid

# vi/etc/php.d/uuid.ini ...

PHP

1.phpコード
<form method=”post” action=””>
<input type=”checkbox” n ...

PHP

書式
/^{4}$/
使用例

<?php$cft = "/^{4}$/";//先頭末尾 数値0-9 英字a-z 4桁 echo preg_match($cft,"4567") . "<br>"; ...

PHP

書式
/^{4}$/ 数値4桁 先頭と末尾も数値
/^{4}/ 数値4桁 先頭も数値
使用例

<?php$cftA = "/^{4}$/";//数値4桁 先頭 末尾数値$cftB = "/^{4}/ ...

PHP

書式
class クラス名
public function 関数名() {
static $変数名 =値
}
static変数のため呼び出すたびに値が増えています。
使用例

< ...

PHP

サンプルコード
//302リダイレクト
$new_url = ‘
header(“Location:$new_url”);

サンプルコード
<?ph ...

PHP

1.送信データを圧縮
修正ファイル:php.ini
修正内容:output_handler = ob_gzhandler

2.output_bufferingを有効にする
修正前
outpu ...

PHP

構文
gettype ( mixed $var ) : string
変数の型を取得する
phpコード

<?php$cft= array(array("A001", "B002", "C003"), ...