How to output the current version number of php: First create a PHP sample file; then enter the content "phpinfo();"; finally execute the file to view the current PHP version information through front-end access.
The operating environment of this article: Windows 7 system, PHP version 5.6.15, Dell G3 computer.
This article mainly introduces how to output the current PHP version number.
For PHP learners, you need to install and configure the PHP service environment before learning PHP. So everyone must know to use the phpinfo() function to check the current PHP version information after configuring the PHP environment.
For example, we directly enter the following code:
<?php phpinfo();
Then we can view my current PHP version information through front-end access.
The information is as shown below:
Then if we don’t use phpinfo to check the current PHP version number.
What method can be used to output and view the current PHP version number?
Now we will introduce to you another way to check the current PHP version number.
The code is as follows:
<?php echo '当前PHP版本: ' . phpversion(); echo phpversion('tidy')."\n";
The result is as shown below:
##Summary, how to get the PHP version number:
phpversion() means getting the current PHP version number.
phpinfo() means outputting information about PHP configuration.
This article is about the method ofphp outputting the current version number. It is very simple and easy to understand. I hope it will be helpful to friends in need!
The above is the detailed content of How to output the current version number in php. For more information, please follow other related articles on the PHP Chinese website!