A raw query in Laravel is returning the below output when I print_r() it.
Array ( [0] => stdClass Object ( [AUTO_INCREMENT] => 28 ) )
How can I extract just the value of AUTO_INCREMENT? In this example, the value being 28.
A raw query in Laravel is returning the below output when I print_r() it.
Array ( [0] => stdClass Object ( [AUTO_INCREMENT] => 28 ) )
How can I extract just the value of AUTO_INCREMENT? In this example, the value being 28.
The value is a property from a stdClass.
Lets say you have this:
$result; \\your ex
echo $result[0]->AUTO_INCREMENT; \\this would echo 28.
You can read more here how to fetch property from object