PHP code example of cse / helpers-cookie

1. Go to this page and download the library: Download cse/helpers-cookie 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/ */

    

cse / helpers-cookie example snippets


Cookie::set('cookie_example', 12345);
// ['cookie_example' => 12345]
if (Cookie::has('cookie_example')) Cookie::remove('cookie_example');
// true
Cookie::get('cookie_example', 67890);
// 67890

Cookie::set('cookie_example', 12345);
// ['cookie_example' => 12345]

Cookie::has('cookie_example');
// true

Cookie::get('cookie_example');
// 12345

Cookie::get('cookie_example_2', 67890);
// 67890

Cookie::remove('cookie_example');
Cookie::has('cookie_example');
// false
bash
phpunit PATH/TO/PROJECT/tests/
bash
phpunit --configuration PATH/TO/PROJECT/phpunit.xml