How to compare php vesrion ?
- by admin
- 0
echo version_compare(PHP_VERSION,’5.0.0′); if our php version is greater than ‘5.0.0’ will print 1.
echo version_compare(PHP_VERSION,’7.0.0′); if our php version is greater than ‘7.0.0’ will print 1.
so,
if(version_compare(PHP_VERSION,’5.0.0′)>=0){
echo “php version is greater or equal to 5.0.0 ”
}
echo version_compare(PHP_VERSION,’5.0.0′); if our php version is greater than ‘5.0.0’ will print 1. echo version_compare(PHP_VERSION,’7.0.0′); if our php version is greater than ‘7.0.0’ will print 1. so, if(version_compare(PHP_VERSION,’5.0.0′)>=0){ echo “php version is greater or equal to 5.0.0 ” }
echo version_compare(PHP_VERSION,’5.0.0′); if our php version is greater than ‘5.0.0’ will print 1. echo version_compare(PHP_VERSION,’7.0.0′); if our php version is greater than ‘7.0.0’ will print 1. so, if(version_compare(PHP_VERSION,’5.0.0′)>=0){ echo “php version is greater or equal to 5.0.0 ” }