خرید بک لینک
Hi, i thought i would do something to verify that the php version on the machine was at least 5.5+ and not 5.4 or lower.

So here is what i came up with, it seems to work but wanted to see if this was the best way to do this.

If the remainder is - [negative] at all then they dont have 5.5 or higher..

here is the code

PHP Code:


        
// $phpvers = phpversion();    //commented out for testing
        
        
$phpvers '5.4.99'//actual version
        
$phpcompared '5500'// this would be the minimum we can have 
        
$checkvers str_replace(".","",$phpvers); // strip away all dots (.) so we can compare integers
        
        
$phpremainder = (int)$checkvers - (int)$phpcompared//which is -1 which is not at least 5.5 

see anything i might have missed?

thanks :)

برچسب: نویسنده: آیلین رضوانی تاريخ: پنجشنبه 7 دی 1396 ساعت: 1:11

صفحه بندی