I'm need to check if memory_limit
is at least 64M
in my script installer. This is just part of PHP code that should work, but probably due to this "M" it's not reading properly the value. How to fix this ?
//memory_limit
echo "<phpmem>";
if(key_exists('PHP Core', $phpinfo))
{
if(key_exists('memory_limit', $phpinfo['PHP Core']))
{
$t=explode(".", $phpinfo['PHP Core']['memory_limit']);
if($t[0]>=64)
$ok=1;
else
$ok=0;
echo "<val>{$phpinfo['PHP Core']['memory_limit']}</val><ok>$ok</ok>";
}
else
echo "<val></val><ok>0</ok>";
}
else
echo "<val></val><ok>0</ok>";
echo "</phpmem>\n";
Checking on command line:
php -i | grep "memory_limit"