How to get current Unix Timestamp in PHP

The below code shows you the way to get current unix timestamp in PHP.

TimestampExample.php
<?php

$currentTimestamp = time();
echo $currentTimestamp;

Output:

1512014782