|
|
|
| Title : |
This functions compares the current PHP version with a
desired version. Because of the 3 tiered version system, a
direct compare of a string to phpversion() will not be
accurate. |
| Categories : |
PHP Configuration, PHP, Variables |
 Brian Moon |
| Date : |
Apr 16th 1999 |
| Grade : |
2 of 5 (graded 2 times) |
| Viewed : |
8414 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Brian Moon |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
<?PHP
function phpvercmp($minver){
$minver=explode(".", $minver);
$cnt=count($minver);
// find max digits in one portion
for($x=0;$x<3;$x++){
$len=strlen($minver[$x]);
if($pad<$len) $pad=$len;
}
$phpver=explode(".", phpversion());
// find max digits in one portion
for($x=0;$x<3;$x++){
$len=strlen($phpver[$x]);
if($pad<$len) $pad=$len;
}
$minver=sprintf("%0".$pad."d%0".$pad."d%0".$pad."d", $minver[0], $minver[1], $minver[2]);
$phpver=sprintf("%0".$pad."d%0".$pad."d%0".$pad."d", $phpver[0], $phpver[1], $phpver[2]);
echo "$minver<br>$phpver<p>";
if($phpver>=$minver){
return true;
}
else{
return false;
}
}
?> |
|
| How can i see the path of the php3.ini file my php3 uses? Categories : PHP, PHP Configuration | | | How to know which input button of type image was pressed in a form with
multiple image buttons (_x and _y) in PHP? Categories : PHP, Variables, HTML | | | How to control the number of decimal places when outputting numbers. Categories : PHP, Strings, Variables | | | Global Dump Highlighted Categories : PHP, Variables, Global Variables | | | Simple script to passing persistent and growing array between recalls of one page (manipulate little stack). Categories : Arrays, Global Variables, PHP, HTML and PHP, Variables | | | How to overide the Max_file_size barier Categories : PHP, PHP Configuration, Filesystem | | | serialize -- Generates a storable representation of a value Categories : PHP, PHP Functions, Variables | | | Step by Step installation
manual for PHP4.1.x on Windows 2000 based systems running IIS5
using CGI or ISAPI Categories : PHP, PHP Configuration, PHP Options and Info, Windows 2000 | | | getting the name of the current script and query string Categories : PHP, Global Variables, Variables, URLs | | | Variable serialization and unserialization. Loading and saving variable structures
to and from file. Categories : Arrays, Filesystem, Variables, Strings, PHP | | | Newbie Notes #5 - To double quote, or single quote, that is the question Categories : PHP, Beginner Guides, Variables | | | Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI Categories : Variables, PHP Options and Info, Arrays, URLs, PHP | | | Define equivalents in php3. Categories : PHP, Variables | | | What to do if PHP3 doesn't find your FreeType library. Categories : PHP Configuration, Installation, PHP | | | Sessions and -enable-trans-sid Categories : PHP, PHP Configuration, PHP Options and Info, Sessions | |
| |
| |
|