PHP code example of zhuchunshu / php-csrf

1. Go to this page and download the library: Download zhuchunshu/php-csrf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zhuchunshu / php-csrf example snippets


// $time为token有效期
return csrf_token($time=120);
// or
return \Csrf\Csrf::get($time);

return \Csrf\Csrf::check($token);