Type in the following in a file named say test.php and save it in document root of your webserver, normally htdocsfor apache:

// prints e.g. ’Current PHP version: 4.1.1′
echo ‘Current PHP version: ’ . phpversion();

// prints e.g. ’2.0′ or nothing if the extension isn’t enabled
echo phpversion(‘tidy’);

Load the file in your browser. For example if you access your home page like:
The output will be as follows

Current PHP version: 5.2.5

Post By Editor (2,827 Posts)

Website: →