Home > Backend Development > PHP Tutorial > Use string function to output integer PHP version number_PHP tutorial

Use string function to output integer PHP version number_PHP tutorial

WBOY
Release: 2016-07-21 16:03:20
Original
1105 people have browsed it

When reusing the program, it is generally necessary to integer the PHP version number to determine the output.

$temp=explode(".",phpversion()); //Get the version number in the form of an array
$num=count($temp); Number of elements in the array
$phpver=0;
switch($num)
{
cas 3:
$phpver=$phpver+(intval($temp[2]));
cas 2:
$phpver=$phpver+(intval($temp[1]*10);
cas 1:
$phpver=$phpver+(intval($temp[0]*100 );
default:
}
echo $phpver;
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/316302.htmlTechArticleWhen reusing the program, you generally need to integer the PHP version number to determine the output. ?php $temp=explode(.,phpversion()); //Get the version number in array form $num=count($tem...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template