Home > Backend Development > PHP Problem > How to check php version

How to check php version

藏色散人
Release: 2023-02-28 09:26:02
Original
5908 people have browsed it

How to check php version

How to check the php version?

The following are two methods to help you check your php version.

Use the phpinfo() function, which is used to display the configuration information of the PHP server. Create a PHP file in your environment, put the code below the data, and then execute it and the following results will be printed. You can You can clearly see that your current php version has configuration information such as php, apache, mysql, etc.

  <?php
  Phpinfo();
  ?>
Copy after login

Use the phpsersion() function. The prototype of this function is string phpversion(void); a string is returned. This function returns the php version information, creates a php file, enter the following code, and you can browse You can see the version information of PHP returned in the browser.

  <?php
  echo phpversion();
  ?>
Copy after login

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to check php version. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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