PHP
SQLSTATE[22021]: Character not in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF8": 0xe3 0x20 0x61 $doc_text = iconv('UTF-8', 'UTF-8//IGNORE', $doc_text);これで様子見する。
excel.soなどをTS(スレッドセーフ)でコンパイルしたいときは、 PHPのコンパイル時に--enable-debugと--enable-maintainer-ztsを付ける必要がある。 http://www.php.net/manual/ja/internals2.buildsys.environment.php
PHPはソースからphp-5.2.13を使った。 Oracle Instant Clientはサインインしてrpmをダウンロードした。 # Oracle Instant Clientのインストール。 rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm rpm -ivh oracle-instantclient11.2-devel-11…
参考URLhttp://www.happyquality.com/2009/09/26/1058.htm if(empty($_POST) && $_SERVER["REQUEST_METHOD"] === "POST"){// post_max_size以上の処理です。throw new Exception("データ量が許容量を超えています。"); }
# 大事なことをよく忘れてしまうのでメモ。 https://www.php.net/manual/ja/function.preg-quote.php $result = preg_replace("/^" . preg_quote($_REQUEST["input"], "/") . "/", "", $text);
よく忘れるのでメモ。参考URL http://php.net/manual/ja/function.preg-split.php文字コードがUTF-8の場合は正規表現の後ろに「u」をつける。 $str_array = preg_split("//u", "マット(幅1,300㎜×長さ4,500㎜㈱Ⅰ", -1, PREG_SPLIT_NO_EMPTY);var_dump($str_a…
http://www.nri-secure.co.jp/ncsirt/2010/0914.html php.iniで disable_functions = eval enable_dl = Off とかしとく?
fetchColumn()は使いまわすな。 $cnt = (int)$stmtCount->fetchColumn(); 以上。
# PHPのプログラム例apache_note("user_id", $user_id); # httpd.confの編集#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedLogFormat "%h %l %{user_id}n %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" comb…
http://oshiete1.goo.ne.jp/qa672939.htmlnext()、each()は使えない。もっときれいな方法があれば教えてください。 $arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9);foreach($arr as $key => $value){echo "現在のvalue:" . $value . PHP_EOL;if(array_key_exists…
php -aInteractive shell php > echo strlen('ハ');←半角の「ハ」3php > 一日はまった・・・
http://itpro.nikkeibp.co.jp/article/COLUMN/20061205/256101/?P=6&ST=oss # ポイントはaptitude install autoconf # ない場合 pecl install apc1-1, 'all', 'abort', or Enter to continue: allUse apxs to set compile flags (if using APC with Apache)?…
ページが見れないのでメモ http://b.astronote.jp/log/eid61.html ちょっと改良して $str = mb_convert_kana($str , 'KVa'); mb_ereg("^[ァ-ヶー\-]+$", $str); 文字コード表 http://hp.vector.co.jp/authors/VA039433/shift_jis-table.html
PHP5.2 + Ajaxhttp://blog.livedoor.jp/t_furu/archives/50634466.html Upload Progress MeterPHP4かPHP5のpatchとextensionhttp://pdoru.from.ro/
例 php -l somefile.php 上の例の出力は、たとえば以下のようになります。 PHP Parse error: unexpected T_STRING in /tmp/somefile.php on line 81
ceil -- 切り上げ floor -- 切り捨て
スクリーンショット # php.ini の php-gtk.codepage を変更php-gtk.codepage = UTF-8# ソースを UTF-8 保存