Hello, if(isset($videos[0]['url'])) { foreach ($videos as $video) { $yonlen = $video['url']; echo "<a href=$yonlen>Download</a><br>"; } PHP: In for each statement, it generates 2 values to the $yonlen, the outputs is Download Download It echos 2 links. I want to make string equals to the latest value in for each statement. How to do that ?
Thank you for the reply but there nothing wrong with that part. The only thing is, it echos 2 values (download links) , I want to echo only latest one.
Sounds like you don't need the foreach then: if(isset($videos[0]['url'])) { $yonlen = $video[0]['url']; echo "<a href=$yonlen>Download</a><br>"; } PHP: