private function checkRun($crontab) {

	    $time 	 = explode(' ', date('i G j n w'));
	    $crontab = explode(' ', $crontab);

	    foreach($crontab as $k => &$v) {

	        $time[$k] = preg_replace('/^0+(?=\d)/', '', $time[$k]);
	        
	        $v = explode(',', $v);

	        foreach ($v as &$v1) {
	            $v1 = preg_replace(['/^\*$/', '/^\d+$/', '/^(\d+)\-(\d+)$/', '/^\*\/(\d+)$/'], ['true', $time[$k] . '===\0', '(\1<=' . $time[$k] . ' and ' . $time[$k] . '<=\2)', $time[$k] . '%\1===0'], $v1);
	        }

	        $v = '(' . implode(' or ', $v) . ')';
	    }

	    $crontab = implode(' and ', $crontab);

	    return eval('return ' . $crontab . ';');
	}
private function checkRun($crontab) {

	    $time 	 = explode(' ', date('i G j n w'));
	    $crontab = explode(' ', $crontab);

	    foreach($crontab as $k => &$v) {

	        $time[$k] = preg_replace('/^0+(?=\d)/', '', $time[$k]);
	        
	        $v = explode(',', $v);

	        foreach ($v as &$v1) {
	            $v1 = preg_replace(['/^\*$/', '/^\d+$/', '/^(\d+)\-(\d+)$/', '/^\*\/(\d+)$/'], ['true', $time[$k] . '===\0', '(\1<=' . $time[$k] . ' and ' . $time[$k] . '<=\2)', $time[$k] . '%\1===0'], $v1);
	        }

	        $v = '(' . implode(' or ', $v) . ')';
	    }

	    $crontab = implode(' and ', $crontab);

	    return eval('return ' . $crontab . ';');
	}
private function checkRun ( $ crontab ) { $ time = explode ( ' ' , date ( 'i G j n w' ) ) ; $ crontab = explode ( ' ' , $ crontab ) ; foreach ( $ crontab as $ k => & $ v ) { $ time [ $ k ] = preg_replace ( '/^0+(?=\d)/' , '' , $ time [ $ k ] ) ; $ v = explode ( ',' , $ v ) ; foreach ( $ v as & $ v1 ) { $ v1 = preg_replace ( [ '/^\*$/' , '/^\d+$/' , '/^(\d+)\-(\d+)$/' , '/^\*\/(\d+)$/' ] , [ 'true' , $ time [ $ k ] . '===\0' , '(\1<=' . $ time [ $ k ] . ' and ' . $ time [ $ k ] . '<=\2)' , $ time [ $ k ] . '%\1===0' ] , $ v1 ) ; } $ v = '(' . implode ( ' or ' , $ v ) . ')' ; } $ crontab = implode ( ' and ' , $ crontab ) ; return eval ( 'return ' . $ crontab . ';' ) ; }
Checks if script should run
@param string $crontab
@return boolean
Checks if script should run