update for php7
This commit is contained in:
@ -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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user