I need to split this:
a:6:{s:8:"address1";s:11:"2 Bourke St";s:8:"address2";s:13:"Woolloomooloo";s:4:"city";s:6:"Sydney";s:5:"state";s:3:"NSW";s:11:"postal_code";s:4:"2011";s:7:"country";s:9:"Australia";}
by ; to pull out the value 2011 found near the end of the string. Even pulling out s:4:"2011" would work.
I am currently using this code:
REPLACE(SUBSTRING_INDEX(address, ';', 10), LENGTH(SUBSTRING_INDEX(address, ';', 10 -1)) + 1), ';', '')
I got it from a site that was listing it as a solution for splitting strings in MySQL... but it has syntax errors in it. I tried debugging it and found that there is one too many ) but I was unable to figure out how to change it to get it to work... I'm lacking understanding of how this is supposed to split strings.
It seems overly complicated compared to this solution...
Can anyone provide assistance? An explanation of how it works would be great or an alternative solution would work as well.
Thanks!