Smarty – ループ内でbreak, continueを利用する
タグ{php}と、phpコードのbreak(continue)を組み合わせることで、テンプレート内ループでもbreak,continueの処理が可能となります。
書き方
{php}break;{/php}
例
{foreach from=$dataList key="key" item="data" name="list"}
{if $data->name eq null}
{php}continue;{/php}
{/if}
名前:{$data->name}<br>
{/foreach}
Net_UserAgent_Mobile – PHPで携帯キャリア判定
Net_UserAgent_Mobile。PHPでの携帯キャリア判定用ライブラリ。PEARのモジュール。
インストール
pearコマンド
C:\xampp\php>pear install Net_UserAgent_Mobile
WARNING: channel “pear.php.net” has updated its protocols,
use “pear channel-update pear.php.net” to update
downloading Net_UserAgent_Mobile-1.0.0.tgz …
Starting to download Net_UserAgent_Mobile-1.0.0.tgz (43,849 bytes)
…………done: 43,849 bytes
install ok: channel://pear.php.net/Net_UserAgent_Mobile-1.0.0
WARNING: channel “pear.php.net” has updated its protocols,
use “pear channel-update pear.php.net” to update
downloading Net_UserAgent_Mobile-1.0.0.tgz …
Starting to download Net_UserAgent_Mobile-1.0.0.tgz (43,849 bytes)
…………done: 43,849 bytes
install ok: channel://pear.php.net/Net_UserAgent_Mobile-1.0.0
C:\xampp\php>
完了

linux – historyコマンド – コマンド実行履歴の確認と再実行
historyコマンドを利用して、最近実行したコマンドを画面に表示する。また、繰り返しタイピングすることなく、コマンドを実行することもできる。
最近実行したコマンドを表示
# history
最近実行したコマンドを10件表示
# history 10
コマンドの再実行
# !履歴番号
例
# !10

