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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.