PHP code example of rundiz / php-scheduler

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

    

rundiz / php-scheduler example snippets


$PhpSchedule = new \Rundiz\PhpSchedule\PhpSchedule();
$PhpSchedule->add('unique-name', 'https://mysite.localhost/page/to/works', ['12', '15']);// run on 12 (midday) and 15.
$PhpSchedule->run();

$PhpSchedule = new \Rundiz\PhpSchedule\PhpSchedule();
$PhpSchedule->add('unique-name1', 'myFunction', ['12', '15']);// run on 12 (midday) and 15.
$PhpSchedule->add('unique-name2', ['myStaticClass', 'myStaticMethod'], ['12', '15']);// run on 12 (midday) and 15.
$MyClass = new MyClass();
$PhpSchedule->add('unique-name3', [$MyClass, 'myMethod'], ['12', '15']);// run on 12 (midday) and 15.
$PhpSchedule->run();