samedi 22 avril 2017

How can I use if in for loop php [duplicate]

This question already has an answer here:

How can I use if in a for loop? If news place is 3 show news, if not dont show.

for ($j=0; $j<5; $j++) {
    if ($place = 3) {
        $news_url_seo = $snews[$j][id] . "-" . seo($snews[$j][title]) . ".html";
        ?>
        <div class="title">
            <a href="<?= $news_url_seo; ?>">
                <?= stripslashes($snews[$j][title]) ?></a>
        </div>
        <?php
    }
}

Aucun commentaire:

Enregistrer un commentaire