i have array and i want print #5 of array
i write this with FOR but not work currently
this is my code and i want to get result with FOREACH
$tagsfinal =Array
(
[0] =say
[1] =hello
[2] =nice
[3] =mans
[4] =wars
[5] =rody
[6] =low
[7] =high
)
for($i=0; $i<5; $i++){
print '<a href="https://example.com/'.$tagsfinal[$i].'" class="ivkeys">' . $tagsfinal[$i] . '</a>';
}
**i want this : **
out=<a href="https://example.com/say" class="ivkeys">
<a href="https://example.com/hello" class="ivkeys">
<a href="https://example.com/nice" class="ivkeys">
<a href="https://example.com/mans" class="ivkeys">
<a href="https://example.com/wars" class="ivkeys">
Anyone know of a good alternative or better way to write this code?
thanks for your helps..