How to properly explode string in wp – Custom Write Panel
-
I’m trying to build a custom write panel using custom fields and I’m stuck. I want put in a string of post id’s into one field separated by commas. Example: 1,5,2
My issue I can’t seem to properly pull the meta back to use in the theme.
Here is my code and I’m not sure if it’s remotely right.
I’m using it in the loop as well.
<?php $mykey_values = get_post_custom_values('tabs'); foreach ( $mykey_values as $key => $value ) { echo "$key => $value ('my_key')<br />"; } ?>
Here is the result: 0 => a:1:{s:4:”tabs”;s:5:”1,5,2″;} (‘my_key’)
I was hoping it would look like this:
1
5
2Thanks,
Phil
- The topic ‘How to properly explode string in wp – Custom Write Panel’ is closed to new replies.