・echoで表示するパターン
This file contains hidden or 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 global $user_ID; | |
get_currentuserinfo(); | |
if (7 == $user_ID) { | |
echo '(´・ω・`)'; | |
} elseif($user_ID) { | |
echo '(`・ω・´)'; | |
} | |
?> |
・echoじゃないパターン
This file contains hidden or 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 ( 20 == $user_ID || '' == $user_ID ) { ?> | |
//ID20がログインもしくはどのアカウントもログインしていない場合 | |
<?php } elseif ( $user_ID ) { ?> | |
//ログインしている場合 | |
<?php } ?> |
※備忘録タグの投稿は、過去に使用したソースやプログラムをいつでも参照できるようにする為のメモ書きです。間違ってたり現在は非推奨になってる場合があるかもしれません、ご了承ください。