Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to use json_decode a post_meta value? [duplicate]

The values look like they have been serialized using maybe_serialize( $data ).

If that’s the case, then you can reverse that with maybe_unserialize( $original ).

As per this answer, unserialize( $str ) will also create a PHP value from a stored representation.


Try:

$mydata="a:3:{i:0;s:6:"ozujak";i:1;s:7:"travanj";i:2;s:7:"svibanj";}";

$mydata = unserialize($mydata);

echo $mydata[0]; // ozujak

Related Posts:

  1. update_post_meta from data in multidimensional array created from a form
  2. update_post_meta() with a modified array?
  3. How to get update_post_meta output to include string length
  4. Retrieving multiple values to the Post Meta (using an array)
  5. Update post meta does not serialize array
  6. Print specific values stored in a post meta array
  7. Random element in get_post_meta array
  8. update_post_meta adding to array instead of replacing value
  9. Add Array record to Meta Post
  10. How i can extract data
  11. update_post_meta array issues
  12. Update Post Meta for Arrays — Remove/Replace Single Value from Multi Dimensional Array
  13. How do I retrieve a value from a multi – dimensional array using get_post_meta? [duplicate]
  14. Printing out JSON array returned [closed]
  15. How to match data in multidimensional array of post_meta_data?
  16. JSON webhook WP Automator – Help with Syntax [closed]
  17. How to extract data from a post meta serialized array?
  18. WordPress is stripping escape backslashes from JSON strings in post_meta
  19. Nice way to print_r arrays
  20. Why does get_users suddenly return duplicates?
  21. When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
  22. Trying to get custom post meta through Jetpack JSON API [closed]
  23. How can merge two arrays values in one array and save in database
  24. WordPress: How to use post_class() in an echo
  25. Is it possible to store arrays in a custom field?
  26. How do I pass an array as an argument to a WP-CLI command?
  27. How to update single value in multi dimensional Post Meta?
  28. JSON not valid after json_encode posts
  29. Updating wp_options with an array on save_post results in duplicated entries
  30. Passing a variable into Contact Form 7 [closed]
  31. Comma seperated list of ID’s as an array?
  32. How to store post meta in an array?
  33. Show the “ratingValue” and “ratingCount” values ​of KK Star Ratings Plugin
  34. WP Meta Query for some meta (array) values
  35. post__in works but also prints the word Array
  36. Make Selected Mutiselect Items “selected”
  37. Compare two meta key values against each other inside the get_posts array?
  38. settings api store multiple array
  39. if is_singular array not working as expected
  40. How do I update a specific object in an array, in user meta?
  41. Get posts id in array by meta value and key
  42. Automatically adding meta data to posts or multiple query help
  43. How to save array of datas in option page by setting api?
  44. Sort a custom post type array numerically
  45. How to add day number and initial to my post graph?
  46. How to validate register settings array
  47. How to check an array of $curauth fields?
  48. Options to get my custom post type metadata via the WordPress API
  49. Problem with wp_update_post
  50. Replace text inside a huge multidimensional array
  51. Mass importing json data into custom fields (postmeta)
  52. How to use IN array properly in WordPress?
  53. var is undefined in a Gutenberg block
  54. Parsing php string in jquery [closed]
  55. Get specific custom field keys from a post and put into an array
  56. My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
  57. WordPress Plugin Dev: Using array for WP options
  58. How to write PHP array to render JSON-LD Markup for Job Postings, with ACF
  59. Only a part of array is stored in transient – what could be causing this?
  60. Return array keys and values
  61. How pass a 0 in $atts?
  62. get_*_meta doesn’t always return an array
  63. How to save data of an input field to an array
  64. Run a check for multiple meta key values
  65. Echoing a variable inside a function
  66. Stuck with a Custom Field Check box Array
  67. Unset field from an array not working as expected
  68. How to display the “ratingValue” and “ratingCount” values ​generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
  69. Compare with WP Meta Query
  70. How to Translate a string of an array inside a class?
  71. How to pass conditional array to wp_localize_script
  72. Modify foreach loop for social sharing links?
  73. Combine get_page_by_title to exclude pages from wp_list_pages
  74. Plugin settings page checkbox not saving – one options array with sub array
  75. Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
  76. Selecting and outputting results from DB with an array
  77. Struggling with array and foreach loop
  78. Customizer Settings in Arrays
  79. WordPress i18n in Array throws Error
  80. How to decipher the following array
  81. Save meta box values as an array to wp_postmeta
  82. How to display line breaked meta values in table?
  83. Post meta as array looks like string instead of array
  84. Organizing and grouping an array by year
  85. Time & Date on Post – Time Ago Custom Function
  86. array_filter warning – wp-includes/post.php line 3148
  87. Output meta into arrays
  88. Get array of metakey in all posts
  89. Hide sidebar if post_type is in array
  90. Can A Post Meta Field Store multiple values that are not in an array?
  91. Create Array from custom post type to display a slider
  92. Array in meta key?
  93. Saving array keep adding length of array
  94. Obtaining values from objects
  95. How to get a page array and category array going at the same time?
  96. search serialised meta_value for date value?
  97. Remove “%” from strings in serialized arrays in wp_postmeta
  98. get_the_terms, whether I should use string or array as the second parameter?
  99. How to use two meta_compare in an array?
  100. Obtaining array item from WordPress revisions output
Categories array Tags array, json, post-meta
Gallery Shortcode Showing IDs
How should I go about registering JavaScript that isn’t a file? [duplicate]

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress