The Little Guy Posted February 11, 2012 Share Posted February 11, 2012 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 More sharing options...
The Little Guy Posted February 11, 2012 Author Share Posted February 11, 2012 Oh wow, sorry, found it. version_compare Link to comment https://forums.phpfreaks.com/topic/256917-php-version-testing/#findComment-1317122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.