Closed FarhanShares closed 6 years ago
$data = $database->select("xxx")...
$object = (object) $data;
I also wasn't asking this way, rather an in-built solution.
@catfan For multiple results, this only converts the outermost array to object. Inside, we still have arrays within arrays within arrays . . . Perhaps it'd be better to do a json encode and then decode into objects.
author should provide options for this ... i have faced this issue ... since pdo usually return object ,,it should follow default pdo behaviour ....
Can I return $medoo->select() or similar methods data as either object or array (array is already given in the example, so Im asking about object availability)?
Its nice to use objects to me: $person->name; $person->age;
instead of: $person['name']; $person['age'];
Also object takes less characters (2: ->) while array takes double (4: [' ']).
I do not know whether this feature already exists, I haven't used medoo yet. If it is, please put down some examples, docs or docs link here.
Other than, Im badly requesting this feature, its pretty and makes coding faster a bit.