i am using a for loop and it returns 3 ids . but how to get those three ids separate instead of getting it inside a for loop. my code is
<? $meta = get_post_custom_keys();
$prev = '';
foreach ($meta as $key) {
$parts = explode (':', $key);
if (count ($parts) == 1 || $parts[0] != 'download')
continue;
$value = get_post_meta (get_the_ID(), $key, true);
echo "<a href='$value'>{$parts[1]}</a>";
}
?>
now in the above echo "<a href='$value'>{$parts[1]}</a>"; gets 3 diffrent values of $values everytime it runs but how to get those ids separate such as value 1 , value 2 and value 3 ?
you can store the $value in an array as
$value[] = get_post_meta (get_the_ID(), $key, true);