If you have Drush installed, you can use drush status
and it will print out the Drush version and the Drupal version you have installed.
If not, go into your Drupal root directory and take a look at the CHANGELOG.txt
file. It will list the most recent upgrade (the current version) at the top.
Edit
If you do not have the CHANGELOG.txt
file, and don't have Drush, you can look in the includes/bootstrap.inc
file, as suggested in the third answer to the question you linked to.
This is defined as a global PHP variable in /includes/bootstrap.inc within D7. Example: define('VERSION', '7.14'); So use it like this...
if (VERSION >= 7.1) {
do_something();
}