Home  >  Article  >  Backend Development  >  How to output the current version number in php

How to output the current version number in php

藏色散人
藏色散人Original
2018-11-29 17:30:1711260browse

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.

How to output the current version number in php

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:

How to output the current version number in php

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 &#39;当前PHP版本: &#39; . phpversion();
echo phpversion(&#39;tidy&#39;)."\n";

The result is as shown below:

How to output the current version number in php

##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 of

php 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!

Statement:
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

Related articles

See more