Home › Forums › General Issues › Is there any problems with saving PHP arrays in a text field ? › Reply To: Is there any problems with saving PHP arrays in a text field ?
If you try to store a value that is an array in WP, WP will automatically serialize that array. When you get that value WP will automatically unserialize the array and it will not work as a text field.
If you want to store and array as a text value then you must manipulate the array before inserting it into the DB, for example by using json_encode()
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.