9951 explained code solutions for 126 technologies


php-wordpressHow to check the PHP version in WordPress?


To check the PHP version in WordPress, you can use the phpversion() function. This function will return the current PHP version as a string.

Example code

echo phpversion();

Output example

7.3.2

The phpversion() function takes no parameters and returns the current PHP version as a string.

Code explanation

  • phpversion(): This is the function used to check the current PHP version.

Helpful links

Edit this code on GitHub