J'ai 2 fonctions checkDay() et checkMonth(), je devais recuperer une variable de checkDay et l'implementer a checkMonth, mais cette variable devenait un objet, comment la convertir en string?
// check day
public function checkDay() {
if(empty($this->day) OR ($this->day > 31))
{
$day_check = 'DayNotValid';
}
elseif(($this->day > 29) && ($this->month == 02))
{
$day_check = 'Daybad29';
}
else
{
$day_check = 'DayValid';
}
$this->day_check = $day_check;
return $this->day_check;
} // end function checkDay($this->day)
// check month
public function checkMonth() {
echo $this->day; // devient un objet et non une string
if(($this->day > 30) && (!in_array($this->month, $this->mw31d)))
{
$month_check = 'Monthbad31';
}
else
{
$month_check = 'MonthValid';
}
$this->month_check = $month_check;
return $this->month_check;
} // end function checkMonth($this->month)
merci a vous