Laravel中的原始查询在print_r()时返回以下输出。
数组([0] => stdClass对象([AUTO_INCREMENT] => 28))
如何只提取AUTO_INCREMENT的值?在此示例中,值为28.
答案 0 :(得分:1)
该值是stdClass的属性。
让我们说你有这个:
$result; \\your ex
echo $result[0]->AUTO_INCREMENT; \\this would echo 28.
您可以在此处阅读更多内容how to fetch property from object