PDO を使用して DB2 に接続した後、PHP がすべてのロケール情報を失う理由はありますか?
接続後は常にロケール情報を再設定する必要があります。
<?PHP
//set locale information
setlocale( LC_MONETARY,'en_US' );
//print location information
print_r(localeconv());
// Array
// (
// [decimal_point] => .
// [thousands_sep] =>
// [int_curr_symbol] => USD
// [currency_symbol] => $
// [mon_decimal_point] => .
// [mon_thousands_sep] => ,
// ...
// )
//************************************************
//create conenction to server
$connection= new PDO("odbc:server", 'username', 'password');
//************************************************
//see locale information after creating a connection
print_r(localeconv());
// Array
// (
// [decimal_point] => .
// [thousands_sep] =>
// [int_curr_symbol] =>
// [currency_symbol] =>
// [mon_decimal_point] =>
// [mon_thousands_sep] =>
// ...
//
// )
?>