Ted Ted - 3 years ago 68
PHP Question

Get seperate keys and values from string where all data is inline

I am using a Custom Meta Box Class for adding meta boxes in Wordpress.

One of the fields I am using is a repeater field to add multiple blocks of the same fields to one post.

When I retrieve the data, all the keys and values are combined inside one string. See this screenshot:
enter image description here


you can see the keys and values with a lot of different characters added.

What I need from this string is

'slide_text_field_title => 'Slide 1'

and the rest of the values.

How could I extract or filter this data from this string?

Answer Source

What you have there is a serialized array.

To convert it back to an array, use:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download