get_post_meta ads an extra “array”?
-
Hello
When I save an array with get_post_meta I’ll get an extra array as this:Array ( [0] => Array ( [0] => https://www.yahoo.com [1] => https://www.internet.com [2] => https://www.google.com [3] => https://www.cnn.com/ [4] => https://www.php.net/ ) )
So when I gonna write it out I have to write like this:
$a = get_post_meta(1,'my_key'); for($i=0;$i<count($a[0]);$i++) { echo $a[0][$i].'<br />'; }
Why this?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_post_meta ads an extra “array”?’ is closed to new replies.