Is there a way to know the avaliable ram in a server (linux distro) with php (widthout using linux commands)?
edit: sorry, the objective is to be aware of the ram av
Small and tidy function to get all of its values associated to their keys.
$contents = file_get_contents('/proc/meminfo'); preg_match_all('/(\w+):\s+(\d+)\s/', $contents, $matches); $info = array_combine($matches[1], $matches[2]); // $info['MemTotal'] = "2047442"