3
I have a function to convert the date, but is returning me an error that I could not adjust:
Follows code:
<?php
class Prog{
private $DtBase;
public function setdata($DtBase){
$this->data = $DtBase;
}
public function getdata(){
return convertData($this->data);
}
public function convertData($data){
$data = Datetime::createFromFormat('d/m/Y', $data);
return $data->format('Y-m-d');
}
}
?>
Error calling the Function convertData:
Call to Undefined Function convertData() in Prog.php on line 11
Any hint ?
A tip, in English
Data
means "data" andDate
meansdia/mês/ano/etc
, it would be interesting to use the names like thisconvertDate
when referring to a day.– Guilherme Nascimento
Yes, I forgot to change why the name of Function before was converterData.
– KevinF