much improved things :)

git-svn-id: http://www.observium.org/svn/observer/trunk@424 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-05-03 22:32:01 +00:00
parent 7d26638df5
commit 7c617d830d
7 changed files with 77 additions and 8 deletions
+25
View File
@@ -23,6 +23,31 @@ require('collectd/functions.php');
require('collectd/definitions.php');
function mac_clean_to_readable($mac){
$r = substr($mac, 0, 2);
$r .= ":".substr($mac, 2, 2);
$r .= ":".substr($mac, 4, 2);
$r .= ":".substr($mac, 6, 2);
$r .= ":".substr($mac, 8, 2);
$r .= ":".substr($mac, 10, 2);
return($r);
}
function zeropad($num)
{
return (strlen($num) == 1) ? '0'.$num : $num;
}
function zeropad_lineno($num, $length)
{
while (strlen($num) < $length)
$num = '0'.$num;
return $num;
}
function only_alphanumeric( $string )
{
return preg_replace('/[^a-zA-Z0-9]/', '', $string);