In that case, the better method to type cast an array to an object that uses the object cast.Ĭonsider $obj = (object) $arr syntax. Even if the second parameter is considered as true, an array will be obtained.Īlso, when json encode operation and decode operation are used, arrays are converted to objects that take up many resources if the array is large. Here, one important point to consider is json_decode that translates a json string to an object, except you offer another option that is boolean which can be true or false.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |