Tag til

Yoda conditions

Yoda conditions are a programming style, which goal is to prevent accidental assignments of variables within conditionals. Such as in the following situations. To prevent that, the constant is placed at the forefront of the statement, therefore raising an exception…

TIL: strtotime function

While researching the `setcookie` function, another one caught my eye. Apparently, instead of writing the time of expiration in unix seconds, you can use human-readable format, neatly parsed by strtotime() ! It for sure improves the readability of the code,…