update for php7

This commit is contained in:
2018-08-04 11:50:40 +02:00
parent 8495e84989
commit 9f7da5deb9
12 changed files with 108 additions and 99 deletions

View File

@ -171,7 +171,16 @@ function get_hour($time) {
}
function ip2str($ip) {
$ip = preg_replace("/(\d{1,3})\.?/e", 'sprintf("%03d", \1)', $ip);
//$ip = preg_replace("/(\d{1,3})\.?/e", 'sprintf("%03d", \1)', $ip);
$ip = preg_replace_callback(
"/(\d{1,3})\.?/",
function($matches){
foreach($matches as $match){
return sprintf("%03d", $match);
}
},
$ip
);
return (string)$ip;
}
@ -326,7 +335,7 @@ function split_kfz($kfz) {
}
function count_total($tocount) {
$result = mysqli_query("SELECT Count(*) as $tocount FROM $tocount");
$result = mysqli_query($dbconn, "SELECT Count(*) as $tocount FROM $tocount");
$result = mysqli_fetch_array($result);
return $result[$tocount];
}