I inherited a database with a location field that contains data in the following style:
a:3:{s:7:"address";s:32:"Belgrade, Serbia";s:3:"lat";s:10:"44.8234945";s:3:"lng";s:17:"20.46218669999996";}
a:3:{s:7:"address";s:30:"Los Angeles, CA, United States";s:3:"lat";s:10:"34.0522342";s:3:"lng";s:12:"-118.2436849";}
a:3:{s:7:"address";s:58:"Wauwatosa, United States";s:3:"lat";d:43.05008220000001;s:3:"lng";d:-87.9901927;}
a:3:{s:7:"address";s:32:"London, England";s:3:"lat";d:51.4743113;s:3:"lng";d:-0.1010046;}
The data in the field varies, but what is constant in all of them is the last part of the string: "lat";d:51.4743113;s:3:"lng";d:-0.1010046;}
I would like to clean them up and extract only the lat and lng from the string from the above and echo them like:
Coordinates: 51.4743113,-0.1010046
Any help is appreciated, many thanks!
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Fellow title is reserved for select members who demonstrate sustained contributions, industry leadership, and outstanding performance. We will announce the experts being inducted into the Experts Exchange Fellowship during the annual Expert Awards, but unlike other awards, Fellow is a lifelong status. This title may not be given every year if there are no obvious candidates.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.