I'm not sure where I am going wrong with this code. I'm simply trying to output an array from a variable into it's separate items.
For example:
$current_endMaps = get_post_meta($post->ID, "_tsb_postmeta_end_maps", true);
Will give me the following output...
["http://localhost/lmn-beta/wp-content/uploads/2017/10/image1.png","http://localhost/lmn-beta/wp-content/uploads/2017/10/image2.png"]
But I am trying to output this as follows...
http://localhost/lmn-beta/wp-content/uploads/2017/10/image1.png
http://localhost/lmn-beta/wp-content/uploads/2017/10/image2.png
Here is what I have so far... but this is only outputting this
[
Here is the code I am using..
$current_endMaps = get_post_meta($post->ID, "_tsb_postmeta_end_maps", true);
$arrlength = count($current_endMaps);
for($x = 0; $x < $arrlength; $x++) {
echo $current_endMaps[$x];
echo "<br>";
}
Any help would be greatly appreciated.
[output is suspicious. View the page source of the resultant output. Do you see additional stuff in there, like broken, non-rendered HTML? Instead ofecho $current_endMaps[$x]debug withvar_dump($current_endMals[$x].for ()loops are rarely used in PHP when iterating an array. This shouldn't affect your output, but instead I'd recommendforeach($current_endMaps as $current_endMap) {...}and access inside simply asecho $current_endMap