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

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -