haidong 发表于 2010-2-24 13:43:49

检查php版本

<PRE>sample call:if(!check_version(PHP_VERSION, "4.1.0") ){   echo 'Current PHP version: ' . PHP_VERSION . ' is too low for this code!&lt;p&gt;';}Function:# Compares versions of software# versions must must use the format ' x.y.z... ' # where (x, y, z) are numbers in function check_version($currentversion, $requiredversion){   list($majorC, $minorC, $editC) = split('[/.-]', $currentversion);   list($majorR, $minorR, $editR) = split('[/.-]', $requiredversion);      if ($majorC &gt; $majorR) return true;   if ($majorC &lt; $majorR) return false;   // same major - check ninor   if ($minorC &gt; $minorR) return true;   if ($minorC &lt; $minorR) return false;   //_and_same minor   if ($editC&gt;= $editR)return true;   return true;} </PRE>

daneo 发表于 2020-6-15 20:56:15

{:6_265:}
页: [1]
查看完整版本: 检查php版本