This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"snippets": { | |
"variables": { | |
"lang": "ja", | |
"locale": "ja-JP", | |
"charset": "UTF-8", | |
"indentation": "\t", | |
"newline": "\n" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$classes = get_declared_classes(); | |
$interfaces = get_declared_interfaces(); | |
$contents = get_defined_constants(); | |
$functions = get_defined_functions(); | |
$separator = ' '; | |
// クラス | |
echo '[クラス]' . PHP_EOL . join($separator, $classes) . PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!version_compare('5.0.0', phpversion(), '<')) { | |
if (!function_exists('array_fill')) { | |
function array_fill($start_index, $num, $value) { | |
$result = array(); | |
for ($i = $start_index; $i < $num + $start_index; $i++) { | |
$result[$i] = $value; | |
} | |
return $result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// エラーの表示をオフ | |
ini_set('display_errors', 0); | |
// エラーは全て捕捉する | |
error_reporting(E_ALL); | |
// エラーハンドラを設定 | |
set_error_handler('my_error_handler'); | |
// エラー格納用グローバル変数 | |
$errors = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define( 'DEFAULT_CHARSET', 'UTF-8' ) ; | |
mb_language( 'Japanese' ) ; | |
mb_internal_encoding( DEFAULT_CHARSET ) ; | |
mb_detect_order( array( 'UTF-8', 'EUC-JP', 'SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2' ) ) ; | |
if( get_magic_quotes_gpc() ) { | |
$_GET = ss( $_GET ) ; | |
$_POST = ss( $_POST ) ; | |
$_COOKIE = ss( $_COOKIE ) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DB{ | |
var $db_encoding="UTF-8"; | |
var $script_encoding="UTF-8"; | |
var $db=null; | |
#--------------------------- | |
# constructer | |
#--------------------------- | |
function DB($db=DBNAME,$user=USER,$pass=PASS,$host=HOST){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cache_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'cache' ; | |
if( realpath( $cache_dir ) === false ) { | |
if( ! mkdir( $cache_dir, 0777 ) ) { | |
exit( 'Error!' ) ; | |
} | |
} | |
$cache_dir = realpath( $cache_dir ) ; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = 1 ; | |
switch( true ) { | |
case ( is_string( $a ) ) : | |
echo '$a は 文字列' ; | |
break ; | |
case ( is_integer( $a ) ) : | |
echo '$a は 数値' ; | |
break ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 「a」という箱に「あ」が入ってる | |
$array['a'] = 'あ' ; | |
// 「b」という箱に「い」が入ってる | |
$array['b'] = 'い' ; | |
// 「c」という箱に「う」が入ってる | |
$array['c'] = 'う' ; | |
// 「い」 を表示したい時は「b」という箱を参照してやる | |
echo $array['b'] ; |
NewerOlder