I have a form that is capturing data sent from a google LocalSearch API. The user has the ability to select a specific result, some or all results via a checkbox i'm injecting into the form with jQuery. The checkbox value looks something like this:
title=Emijean+Web+Design+and+Management&streetAddress=63+James+St.&city=Parry+Sound®ion=ON
So if I had multiple checkboxes they would all contain similar data and the post value for checkboxes addToDb[] would be an array full of the above.
What's the best way for me capture this data with my php script? I can figure it out using foreach
, explode
, etc. but I'm sure there must be a way to unserialize a javascript string using PHP that's more efficient.
Any ideas on how I could get output similar to this:
array(
[0] => array(
title => "Emijean Web Design and Management"
streetAddress => "63 James St."
city => "Parry Sound"
region => "ON"
)
)
Thanks everybody.