php object attribute with dot in name

前端 未结 5 479
借酒劲吻你
借酒劲吻你 2020-11-29 12:28

I have mysql table with collumns like \'operation.date\', \'operation.name\' and etc. After fetching that table data as object with $mysqli->fetch_object() i

5条回答
  •  失恋的感觉
    2020-11-29 12:34

    The correct way of accessing properties with a dot should be :

    echo $object->{"operation.date"}
    

提交回复
热议问题