1

I want to parse this I tried almost everything but I couldn't understand this , I m getting this from WordPress database table wp_postmeta. Tried - unserialize , serialize, json_encode

string(303) "s:294:"a:1:{i:2364;a:1:{s:9:"schedules";a:1:{s:13:"578db85b83681";a:5:{s:13:"minutes_start";s:3:"540";s:11:"minutes_end";s:4:"1020";s:5:"weeks";a:6:{i:0;s:2:"on";i:1;s:2:"on";i:2;s:2:"on";i:3;s:2:"on";i:4;s:2:"on";i:6;s:2:"on";}s:10:"date_start";s:10:"07/18/2016";s:8:"date_end";s:10:"09/30/2016";}}}}";"
5
  • That doesn't look like valid JSON. What errors are you getting? Commented Sep 19, 2016 at 13:13
  • there in no error when i doing var_dump getting this Commented Sep 19, 2016 at 13:14
  • That is a string generated by serialize() so it should unserialize() unless there is an error in the string Commented Sep 19, 2016 at 13:15
  • Yup: The "s:294: does not belong in that encoding Commented Sep 19, 2016 at 13:18
  • you are right here Commented Sep 19, 2016 at 13:27

1 Answer 1

1

Try unserialize(). This worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.