Делал так и буду делать, т.к. это удобно и достаточно читаемо. Фанаты делать 3 строки из 1-й идут лесом…
if(condition)
....doSomething();
if(condition)
....doSomething();
....doSomethingElse();
[Thu Aug 04 10:36:37 2011] [notice] caught SIGTERM, shutting down
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ps.ini on line 1 in Unknown on line 0
[Thu Aug 04 10:36:38 2011] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze3 with Suhosin-Patch configured -- resuming normal operations
$ar = array("name"=>'значение');
$json=json_encode($ar);
mysql_connect("localhost", "qwer", "qwer");
mysql_select_db("termito");
mysql_query('set names utf8');
$q=sprintf("INSERT INTO `cin`(`info`) VALUES('%s')", $json);
echo $q;
mysql_query($q);
mysql_connect("localhost", "qwer", "qwer");
mysql_select_db("termito");
mysql_query('set names utf8');
$r = mysql_query("select * from `company_info` WHERE `id`=".mysql_insert_id());
$r = mysql_fetch_array($r);
$a = json_decode($r['info'],true);
echo(($a['name']));
/*на выходе упорно u0437u043du0430u0447u0435u043du0438u0435*/
iconv('cp1251', 'utf-8', 'значение');