PHP code for creating CSRF token

<?php
session_start();

$secretKey = 'Here goes a secret key that you have';
$token = hash('sha256', md5(time() . $secretKey));

?>