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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -