/ Published in: PHP
this function return associative array from SERVER_SOFTWARE
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getServerSoftware($key = 'SERVER_SOFTWARE') { $regex = "/(?<software>\w+)\/(?<version>[0-9.a-z]*)/"; else } //USAGE EXAMPLE //get array $serverInfo = getServerInfo(); //print apache version echo $serverInfo['Apache']; //print all information foreach($serverInfo as $software=>$version) echo "{$software}: {$version}<br>\n";