我需要实现一个每天早上 8:00 运行的 cron 作业。我不知道需要做什么。cron 应该在这个文件上运行一个函数 greet()。
<?php
class Person {
public $age=0;
public $isalive=false;
public $name;
public $msg;
public $isAlive=true;
public $firstname;
public $lastname;
public function __construct($fname,$lname,$age){
$this->firstname=$fname;
$this->lastname=$lname;
$this->age=$age;
$this->name=$fname." ".$lname;
//$this->isAlive=$isAlive;
}
public function greet(){
echo "$this->name says $this->msg my age is $this->age <br> am I alive:$this->isAlive";
}
}
$teacher = new Person('boring','12345',12345);
$student = new Person('Swapnil','Shende',24);
echo $student->age;
?>