Does this code do anything? Somehow I made a mistake and wrote this code. However, this mistake turned out to be a boon. This solved my problem 😀
$arr_centres = (array) $centres_array[0];
But I want to know what this does. The centres_array is like this:
stdClass Object (
[ExampleCentre] => Array (
[0] => stdClass Object (
[ID] => 14
[Name] => mycity
[Code] => exm
[Email] => example.web@example.com
[FB] =>
[Address1] => Exm, example
[City] => Hakuna Matata
[PostCode] => 000000
[County] =>
[Fax] => Fax
[Telephone] => 000222888
[Location] => 01.000000,-0.00004
[URL] => /holla/hakuna/example
)
It casts your stdClass object as an array.
More info: http://php.net/manual/en/language.types.type-juggling.php