Despite I use $object->getCreatedAt() function I cant fetch the createdAt column's values. Need help. Thanks in advance for all.
$tableFetch = new Database(); // This is my custom class structure
$subscriptions = $tableFetch->tableFetch("Subscribe");
for ($i = 0; $i < count($subscriptions); $i++) {
$object = $subscriptions[$i];
$createdAt = $object->getCreatedAt();
}
Edit: I can get the information of array but cant slice it with keys.
I found the answer.
After creating DateTime Object need to specify format as below.
$createdAt->format('Y-m-d H:i:s');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.