PHP Object Property has brackets in it

后端 未结 2 944
再見小時候
再見小時候 2021-01-12 05:53

Hopefully a very easy question for you. I have a PHP object, one of the properties has brackets in it (from using MIN mysql command):

stdClass Object ( [uid]         


        
2条回答
  •  情歌与酒
    2021-01-12 06:14

    you could modify your select statement to give the field an alias like:

    ex. SELECT min(time) as min_time....
    

    then your returned object should have this indexed like so $obj->min_time.

    i hope this helps.

提交回复
热议问题