PHP Hacks #1 - $_SERVER['REQUEST_TIME']steemCreated with Sketch.

in #php7 years ago (edited)

This is the #1 article of the series I call "PHP Hacks".

Here I will show some cool hacks that will make your web applications better.

---

#1 hack I want to show you is:

Explaining about $_SERVER['REQUEST_TIME'].


You should know that if you want to know script execution time, there is no need to constantly use time(), or try to save it to some global.

You already have it in predefiend variable $_SERVER.

 $_SERVER contains server and execution environment information.


So in all your scripts, use  $_SERVER['REQUEST_TIME'] instead of time(), unless it is critical to you to get exact time of execution (in most cases it less matters)


Coin Marketplace

STEEM 0.19
TRX 0.18
JST 0.035
BTC 91312.67
ETH 3187.07
USDT 1.00
SBD 2.80