I've converted this array from stdclass object.
I'm using var_dump to print the output of an array which is something like this:
array (size=1)
'fruits' =>
array (size=2)
0 =>
object(stdClass)[2]
public 'name' => string 'apple' (length=5)
public 'origin' => string 'kashmir' (length=7)
public 'number' => int 50
1 =>
object(stdClass)[1]
public 'name' => string 'orange' (length=6)
public 'origin' => string 'nevada' (length=6)
public 'number' => int 20
I know var_dump also gives the datatype and length. However, I want the output to be something like this:
1.{
'name':'apple',
'origin':'kashmir',
'number':50
},
2.{
'name':'orange',
'origin':'nevada',
'number':20
}
Can anybody please help me?