Run PHP 24hrs After Event Trigger

In below function take the registration date of the user and add 24 hours to the registration date. If current time matches the $notify time then send message.

$notify = date("Y-m-d H:i:s",strtotime("+24 hours",strtotime($registration_date)));
if(date("Y-m-d H:i:s")==$notify){
    //send message code
}