2013-03-01から1ヶ月間の記事一覧

isset()はnullもfalseを返す

php

つい忘れてしまうのでメモ。何も考えずに添字の有無チェックに使わないよう注意。 //こんな感じでチェックすればissetでfalseになっても同じnullだから良いかも $arr = array('a'=>1,'b'=>2,'c'=>null); $var = isset($arr['c']) ? $arr['c'] : null; 定期的…

kernel: Disabling IRQ #169

IRQ #169 が競合しているcat /proc/interrupts ... 169: 403 199630 IO-APIC-level yenta, eth0 ... DRBDの同期をとると下記メッセージが、/var/log/messagesに履かれ、sshの接続が極端に重くなる。kernel: Disabling IRQ #169 どうやらeth0とdrbdが競合して…

this.formで自分のフォームを参照

忘れないようにメモ(といっても絶対忘れるだろうけど)this.formを使えば自分のフォームを参照できる(ただしAタグでは無理)複数フォームがある場合など便利 <form target="win" action="test.html" method="post"> <input type="button" onclick="openwin(this.form)" value="送信" /> </form> <script> function openwin(form){ window.open("","win"); form.submit(); } </script>

utf8を使う場合のphp.ini の設定

php

デフォルトのままだとメールで文字化けするので下記設定を行う [mbstring] mbstring.language = Japanese mbstring.internal_encoding = UTF-8 mbstring.http_input = auto mbstring.http_output = UTF-8 mbstring.encoding_translation = Off mbstring.dete…