PHP code example of dazzle-php / event

1. Go to this page and download the library: Download dazzle-php/event 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/ */

    

dazzle-php / event example snippets


use Dazzle\Event\EventEmitter;

$emitter = new EventEmitter();

$emitter->on('script.start', function($user, $time) {
    echo "User '$user' has started this script at $time.\n";
});

$emitter->emit('script.start', [ get_current_user(), date('H:i:s Y-m-d') ]);

$> composer