What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I\'ve got a PHP script that adds/removes entries from a crontab
There is a nice PHP library that can be used for Cron expression validation:
To install this library via composer:
composer require mtdowling/cron-expression
To check if Cron expression is valid
$isValid = Cron\CronExpression::isValidExpression($expression);