Something
public text v1 · immutable<?php
function getValue($file, $value) {
$value = $value . "=";
$handle = fopen($file, "r");
$contents = fread($handle, filesize($file));
$arrExplodeNewLine = explode("\n",$contents);
foreach ($arrExplodeNewLine as $wholeline) {
if ($value == substr($wholeline, 0, strlen($value))) {
echo substr($wholeline, strlen($value));
}
}
}
getValue("sc_serv.conf","MaxUser");
?>
[test@server ~]$ php test.php
[test@server ~]$ php test.php | more
32
[test@server ~]$