foreach ($links as $link) {
$text = trim($link->nodeValue);
$text = preg_replace('/^\d+\./', '', $text);
echo "<li><a class='content-tags-content' href='https://mysite.net/search/" . $text . "'>" . mb_strimwidth($text, 0, 25, '...') . "<p class='content-tags-help'>Trending Now</p></a></li>";
} Sayı Nasıl Belirlerim Ustalar.
3
●94
- 29-06-2023, 00:22:30ustalar aşağıdaki gibi bir foreach döngüm var bir siteden bi veri çekiyor ve bu 10 adet 10 başlık ben bunu nasıl 8 adet ile sınırlandırabilirim? 10 adet başlık geliyor ama ben 8 ile sınırlandırmak istiyorum?
- 29-06-2023, 00:27:14
$i = 0; foreach ($links as $link) { if($i >= 8){ break; } $i++; $text = trim($link->nodeValue); $text = preg_replace('/^\d+\./', '', $text); echo "<li><a class='content-tags-content' href='https://mysite.net/search/" . $text . "'>" . mb_strimwidth($text, 0, 25, '...') . "<p class='content-tags-help'>Trending Now</p></a></li>"; } - 29-06-2023, 00:31:41çok teşekkürler üstad.. iyi bayramlar dilerim.eypoffcl adlı üyeden alıntı: mesajı görüntüle