\Phalcon\Mvc\Model::setup([
'columnRenaming' => false
]);
$('input:select[name="country"]').filter(h_country).attr('checked', true);
$('select[name="country"]').filter(h_country).attr('selected', 'selected');
git clone https://github.com/json-c/json-c.git
/**
* PHP 5.4.0+
*
* @param $a
* @param $b
* @param ...$N
* @return array
*/
function array_keys_merge($a, $b)
{
foreach ($b as $key => $value) {
if(!array_key_exists($key, $a)) {
$a[$key] = [];
}
if (!is_array($a[$key])) {
$a[$key] = [$a[$key]];
}
$a[$key][] = $value;
}
if (func_num_args() > 2) {
$args = array_slice(func_get_args(), 2);
array_unshift($args, $a);
return call_user_func_array('array_keys_merge', $args);
} else {
return array_map(function($value) {
return is_array($value) ? implode(',', $value) : $value;
}, $a);
}
}
$a = array('1'=>'2','2'=>'2','3'=>'2');
$b = array('1'=>'2','4'=>'2', '1'=>'2');
$c = array_keys_merge($a, $b, $b, $a, $b);
$text = 'Я очень проголодался, не против бы пойти в столовую.';
$words = [
'проголодался' => 'site1.com',
'пойти в столовую' => 'site2.com'
];
$patterns = array_map(function($v) {
return '#(' . $v . '\b)#iu';
}, array_keys($words));
$replacements = array_map(function($v) {
return '<a href="' . $v . '">\1</a>';
}, array_values($words));
$text = preg_replace($patterns, $replacements, $text);
echo $text; // Я очень <a href="site1.com">проголодался</a>, не против бы <a href="site2.com">пойти в столовую</a>.
$crc = ($crc >> 8) ^ ('0x' . substr($table, (($crc ^ ord(substr($str, $k, 1))) & 0x000000FF) * 9, 8));
if (preg_match('#^\/item\/[0-9]+\/.+#i', $_SERVER['REQUEST_URI'])) {
header("HTTP/1.0 404 Not Found");
include $_SERVER['DOCUMENT_ROOT'].'/404.php';
exit();
}