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
https://forums.phpfreaks.com/topic/93097-if-php-version-5-do-this/
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.