I have a PHP string that looks like this
$string = 'This is day 7 of the task';
The number changes depending on what is happening that week so I am trying to do an if statement to check a number has been set like this
if ($string == 'This is day 7 of the task') {
echo 'Task day is set to a number';
}
I now want to match it regardless of what the number is, what is my best approach, regex?
Something like this maybe?
$string = 'This is day 7 of the task';
$isAMatch = preg_match("/This is day \(\d)+\ of the task\/", $string);