PHP

現象
Warning: Use of undefined constant xxx – assumed ‘xxx’ (this will throw an Error in a future ...

PHP

説明
json_decode ( string $json ]] ) : mixed
JSON エンコードされた文字列を受け取り、それを PHP の変数に変換します。
パラメータ
json
デコ ...

PHP

説明
addslashes ( string $str ) : string
エスケープすべき文字の前にバックスラッシュを付けて返します。 エスケープすべき文字とは、以下のとおりです。
シングルクォート (&# ...

PHP

説明
parse_str ( string $encoded_string ) : void
URL 経由で渡されるクエリ文字列と同様に encoded_string を処理し、
現在のスコープに変数をセット ...

PHP

説明
format 文字
h 時間、数値
i 分、数値
a DateTime::diff() の結果に使った場合は総日数
PHPコード

<?php//DateTimeクラスのインスタ ...

PHP

説明
nl2br ( string $string ) : string
string に含まれるすべての改行文字 (\r\n、 \n\r、\n および \r) の前に <br/> あるいは <br ...

PHP

構文
while( 条件 ) {
//条件が true の場合に行う処理コード
}
PHPコード

<?php$i=0;while ( $i<8 ) { echo $i ."<br ...

PHP

構文
$key => $value
PHPコード

<?php$cft = ;foreach ( $cft as $key => $value) { echo $key .",". $value ...

PHP

構文
foreach ( 配列 as 配列値の変数 ) {
//処理コード
}
PHPコード

<?php$cft = ;foreach ( $cft as $value ) { echo $ ...

PHP

説明
strtotime ( string $datetime ) : int
この関数は英語の書式での日付を含む文字列が指定されることを期待しており、 now で与えられたその形式から Unix タイムスタンプ ( ...

PHP

説明
public DateTimeImmutable::modify ( string $modifier ) : DateTimeImmutable
タイムスタンプを変更した新しい DateTimeImmutabl ...

PHP

説明
date_diff ( DateTimeInterface $originObject , DateTimeInterface $targetObject ) : DateInterval
パラメータ

PHP

説明
\\–バックスラッシュ
\$–ドル記号
\’–シングルクォーテーション
\”–ダブルクオーテーション(2重引用符
P ...

PHP

構文
static 変数名
PHPコード

<?phpclass SampleTest{ public function cftFunc() {//static 変数名 static $x = 5; $x++ ...

PHP

関数説明
public static function 関数名{
static 変数名
}
PHPコード

<?phpclass SampleA{ public static function ...

PHP

説明
ブラウザの改行タグコード: <br>
改行文字コード:”\n”
phpコード
<?php
$str = “aaa”. ...

PHP

書式
while (条件式){
処理コード
}
サンプルコード

$count = 0;while ($count < 8){ if ($count === 3) { $count ++; c ...

PHP

書式
while (条件式){
処理コード
}
サンプルコード

$count = 0;while (true){ if ($count === 5) { break; } echo "$count ...