ini_set or function?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • henryrhenryr
    New Member
    • Jun 2007
    • 103

    ini_set or function?

    Hi

    Just wanted to find out which one is 'better': using ini_set() to change settings or using a function (eg below). By better I mean faster / more secure or balance of the two. The PHP manual doesn't seem to distinguish.

    For example I'm looking at either:

    [code=php]
    ini_set('date.t imezone',...)
    [/code]

    or
    [code=php]
    date_default_ti mezone_set();
    [/code]

    Thanks
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    The date_default_ti mezone_set function validates the timezone before setting it and generates a notice if it is invalid. It will also probably be a little slower, due to the validation, but by such a small margin that it is completely irrelevant.

    I imagine that it simply does the validation and then calls the ini_set function, just like you did.

    So if you want the validation, use the function. If not, just use ini_set.

    Comment

    Working...