datetime - php date->foramt() return object instead of string -
i want output date object string using ->format()
when return function php automatically convert string? how prevent that?
function setpassword($currorder) { $checkindate = $currorder->checkindate; // return date object $checkindate = $checkindate->format('j/m/y'); print_r(gettype($checkindate)); // output string return $checkindate; } print_r( gettype($thisguest->setpassword($thisorder)) ); // return object
in case problem caused becaus variables case-sensitive, $checkindate
, $checkindate
2 different variables. correct , should fine.
Comments
Post a Comment