how to get php version in php code example Example 1: php get version Click to copyecho PHP_VERSION; Example 2: check php version Click to copy/* in terminal type it*/ php -v