note 57650 deleted from function.phpversion by bjori

From: Date: Tue, 07 Mar 2006 13:43:58 +0000
Subject: note 57650 deleted from function.phpversion by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-104989@lists.php.net to get a copy of this message
Note Submitter: Willem ---- A little more easier and compact ;) <? /** * bool phpversion2 ( string version ) * * var version : user version of php needed to be compared to the server version of php, * must respect the correct format ' x.y.z ' where (x, y, z) are numbers in [0-9] */ function phpversion2 ($version = "5.0.5") { // does the ' user php version ' have the right format ? if (preg_match("/(^\d+\.\d+\.\d+$)/", $version) == null) { return false; } if (str_replace(".", "", phpversion()) >= str_replace(".", "", $version)) { return true; } return false; } ?>

« previous php.notes (#104989) next »