Jump to content

if php version >= 5 do this...


ukweb

Recommended Posts

Hi there.

 

I have a communally accessed include file which is used by a number of websites, operating from many different servers, no problems there (I'm sure there are those who would disagree!!!)

 

Problem comes with the current site I'm working on, the client specifically stated that the site is to exist on the server it is on, and that server runs only PHP version 4. 99.9% of my code in the include file works with version 4, apart from 1 line...

 

that line has the function date_default_timezone_set(). This only works with version 5 as far as I am aware. So here's the solution...

 

if (php version >= 5) {

date_default_timezone_set();

}

 

Basically if the php version isnt 5 or greater, dont run the date_default_timezone_set function.

 

but is there a server variable which contains the php version??? I cant find one? anyone else got any ideas? Thanks

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.