foreach($array as $key => $value){
$string = str_replace($key, $value, $string);
}
$dbh = new PDO("mysql:dbname={BEZ_DATABASE};host={BEZ_DBSERVER}", BEZ_DBUSER, BEZ_DBPASSWORD);
$dbh->exec("
SET NAMES utf8;
set character_set_client='utf8';
set character_set_results='utf8';
set collation_connection='utf8_general_ci'
");
$("button").click(function(e){
e.preventDefault();
// тут всякие действия
$(this).closest("form").submit();
});
function _sort($a, $b){
if(strlen($a) == strlen($b)){
return 0;
}
return (strlen($a) < strlen($b)) ? 1 : -1;
}
usort($arr, "_sort");