I have got strings like:
name="n e" content="12" icon="favicon.ico"
What is the best and quickest way to parse it as such array:
Array
(
[name] => "n e"
[content] => "12"
[icon] => "favicon.ico"
)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This should do it, using
preg_match_all()to get all the groups andarray_combine()to form the final array:Edit
This alternative breaks when there are spaces in between the double quotes; otherwise it works as well: