php - Retrieving value from object
865
I cant get the value out of [Create Table] because of the space.
I create the object like this...
$create_table = DB::select('SHOW CREATE TABLE '.$table_name)[0];
And this is what the object looks like...
stdClass Object
(
[Table] => contact_monitor
[Create Table] => CREATE TABLE `contact_monitor` (
`contact_id` int(11) DEFAULT NULL,
`monitor_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
)
However, I can get the value out of [Table] using$create_table->Table
Answer
Solution:
Just use a
{}
curly brace to access those properties with spaces: