Hello im trying to receive the 2.2.8 or what ever the value will be on the server's config. (the server is mine 🙂 )

function get_Apache_Version(){
$resource = apache_get_version();
$pattern = preg_match ('/Apache/2.2.8 (Win32) PHP/', $resource)
$retval = explode ($pattern, $resource);
return $retval[1];
}

For some reason this isn't working, im not good with preg_match(); :p

Thanks in advance.

    Try something like:

    $resource = apache_get_version();
    if(preg_match('@Apache/([0-9\.]+)@', $resource, $matches))
        return $matches[1];
    else
        return false; // couldn't locate version #

      your the best +rep (if there was rep on this forum :p )

        Write a Reply...