I have an table in my database which so far has been great for storing stuff in more than one object. But i want to be able to transform it into a multi-object array thingy.
Here is the data which is related to this new ‘object’ (in mysql):
uid field value
page:1 shop[2].location In Shops, Dundas Arcades,Middlesbrough, TS1 1HT
page:1 shop[1].location 5a High Street, Stockton-on-tees, TS18 1UB
page:1 name Enter The Asylum
page:1 contact.website http://entertheasylum.co.uk
page:1 contact.phone 0800 090 090
Now what i’m looking for is to via PHP transform it into something like (print_r output):
array(
"name" => "Enter The Asylum",
"shop" => array(
array("location" => "In Shops, Dundas Arcades..."),
array("location" => "5a High Street, Stockton-on-tees...")
),
"contact" => array(
"website" => "http://entertheasylum.co.uk",
"phone" => "0800 090 090"
)
)
anybody got any ideas?
I’ve managed to do this via regex and php. Here is the magic function (it’s part of my code and stuff):
it works! yay!