以下のコード スニペットを参照してください。
<?php
// Top of the page, before sending out ANY output to the page.
$user_is_first_timer = !isset( $_COOKIE["FirstTimer"] );
// Set the cookie so that the message doesn't show again
setcookie( "FirstTimer", 1, strtotime( '+1 year' ) );
?>
<H1>hi!</h1><br>
<!-- Put this anywhere on your page. -->
<?php if( $user_is_first_timer ): ?>
Hello there! you're a first time user!.
<?php endif; ?>
私のコーディング経験では、ほとんどの場合、ステートメントのようなステートメントを見てきまし!isset( $_COOKIE["FirstTimer"] )
たif
。私の人生で初めて、代入演算子でそのようなステートメントを観察しています。
上記のコードでは、ステートメントが何をするのかを理解したいだけです$user_is_first_timer = !isset( $_COOKIE["FirstTimer"] );
か?
このコード行での論理 not(!) 演算子の役割は何ですか?
信頼できる適切な説明で私の疑問を解消してください。
ありがとうございました。