Skip to content

Instantly share code, notes, and snippets.

@webmechanicx
Created March 3, 2016 00:15
Show Gist options
  • Save webmechanicx/5f157420d20f0077229d to your computer and use it in GitHub Desktop.
Save webmechanicx/5f157420d20f0077229d to your computer and use it in GitHub Desktop.
Simple Demonstration object to Array
<?php
$post_id = array((object) (array(
'index_id' => 'Mahfuz',
)), (object) (array(
'index_id' => 'mstmhaque@gmail.com',
)), (object) (array(
'index_id' => 142,
)));
foreach ($post_id as $key => $value) {
$result[] = $value->index_id;
}
print_r($result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment