Warning: Undefined array key 0 in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 406
Warning: Attempt to read property "parent" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 407
Warning: Attempt to read property "term_id" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413
Warning: Attempt to read property "cat_name" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413
変数の宣言と命名規約
PHPでは変数の頭に「$」を付けて変数を宣言します。 変数の命名規約は以下の通りです。
- 先頭はアンダーバー or アルファベット
- 先頭以外はアンダーバー or 数字 or アルファベット
- $thisは特別な用途があるため使用できません
- 大文字と小文字は区別される。例えば$argと$Argは別の変数として扱われる
正しい変数宣言例
arg;
$_arg2;
$a_r_g_3;
間違った変数宣言例
rg; //頭に$が付いていないため無効
$4arg; //先頭が数字なため無効
$arg@ //アンダーバー以外の記号を使ったため無効


