Jump to content

php version testing


The Little Guy

Recommended Posts

I have a part of my code that requires php 5.3+ how can I test to see if the user has 5.3 or greater?

 

At first I thought this would be a good idea, but then I realized that it isn't such as a version: 5.2.10 (not sure if that is an actual version or not).

if((int)preg_replace("/\./", "", phpversion()) >= 530){
// Allow functionality
}

 

using my code, using 5.2.10 it would allow it, but it shouldn't because it isn't larger than 5.3.

 

what can I do?

Link to comment
https://forums.phpfreaks.com/topic/256917-php-version-testing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.