For example, Firefox 1.5's UA is...
So if we printed out the variable we'd get...Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
But I simply have no clue how to do this in PHP!1.8
Anyway here is the working JavaScript.
John<script type="text/javascript">
<!--
var str = navigator.userAgent;
/***
/^rv\:|\).*$/g
***/
var gecko = str.replace(/^Mozilla.*rv:|\).*$/g, '' ) || ( /^rv\:|\).*$/g, '' );
document.writeln(gecko);
var version = gecko.substring(0,3);
if (version == 1.6) {document.writeln('<br />1.6')}
else if (version == 1.7) {document.writeln('<br />1.7')}
else if (version == 1.8) {document.writeln('<br />1.8')}
else if (version == 1.9) {document.writeln('<br />1.9')}
else {document.writeln('<br />Unknown Gecko code')};
//-->
</script>