- Messages
- 4,148
- Reaction score
- 5
- Points
- 38
odd, cause without the
I get the same old tag sitting there.
PHP:
$tmp4 = explode('>',$tmp3[0]);
$tmp3[0] = $tmp4[1];
$tmp4 = explode('>',$tmp3[0]);
$tmp3[0] = $tmp4[1];
function parseIndex2($key)
{
$value = array();
preg_match('/' . $key . '([^MB]*)/', $this->HTTP->getData('index.html'), $value);
$tmp = strip_tags($value[1]);
$value[1]= $tmp;
return $value[1];
}
function getSpaceUsed()
{
$tmp = $this->parseIndex2('Disk Space Usage');
$tmp1 = explode('/',$tmp);
settype($tmp1[0], 'float');
return $tmp1[0];
}
function getBandwidthUsed()
{
$tmp = $this->parseIndex2('Monthly Bandwidth Transfer');
$tmp1 = explode('/',$tmp);
settype($tmp1[0], 'float');
return $tmp1[0];
}
I'm not currently using the cPanel API to get the used disk space (Although I'm probably just about to change it) I use a function that just goes though and counts up the size of every file in my account.Really odd that the disk space was working and not the bandwidth. I got the same problem from both
Should be:settype($tmp1[0], $type);
settype($tmp1[0], float);
getSomethingUsage("Disk Space Usage");
->getSomethingUsed('Identifier');
->getSomethingMax('Identifier');
->getSomethingFree('Identifier');
->getSomethingInfo('Identifier')