je le code HTML suivant:Troubles affichant un tableau associatif avec PHP et HTML
<div id="newsTicker">
<span class="icon news"></span>
<ul>
[repeating structure]
<li>
<ul>
<li><a href="#">News 1</a></li>
<li><a href="#">News 2</a></li>
<li><a href="#">News 3</a></li>
</ul>
</li>
[/repeating structure]
</ul>
</div><!--/#newsTicker-->
J'ai aussi un tableau PHP:
Array
(
[0] => Array
(
[id] => 5
[title] => Concert Aria Urbana
[link] => http://www.searadeseara.ro/detalii-eveniment/aria-urbana-9.html
[date] => 2010-05-22 14:59:20
)
[1] => Array
(
[id] => 4
[title] => Poze Tequila Party
[link] => http://www.searadeseara.ro/detalii-galerie/tequila-party-3/
[date] => 2010-05-22 14:58:56
)
[2] => Array
(
[id] => 3
[title] => Psyche este utilizatorul saptamanii
[link] => http://www.searadeseara.ro/profil/1-Psyche.html
[date] => 2010-05-22 14:48:03
)
[3] => Array
(
[id] => 2
[title] => Galerie foto Summer Party
[link] => http://www.searadeseara.ro/detalii-galerie/summer-party-8/
[date] => 2010-05-22 14:25:13
)
[4] => Array
(
[id] => 1
[title] => Concert Massive Attack
[link] => http://www.searadeseara.ro/detalii-eveniment/massive-attack-revin-la-bucuresti-13.html
[date] => 2010-05-22 14:24:37
)
)
Je voudrais savoir comment je peux répéter code à l'intérieur [structure extensible] et affiche 3 nouvelles différentes pour chaque structure répétitive.
La sortie doit ressembler à ceci:
<div id="newsTicker">
<span class="icon news"></span>
<ul>
<li>
<ul>
<li><a href="#">Concert Aria Urbana</a></li>
<li><a href="#">Poze Tequila Party</a></li>
<li><a href="#">Psyche este utilizatorul saptamanii</a></li>
</ul>
</li>
<li>
<ul>
<li><a href="#">Galerie foto Summer Party</a></li>
<li><a href="#">Concert Massive Attack</a></li>
</ul>
</li>
</ul>
</div><!--/#newsTicker-->
Merci.
pourquoi ne pas vous poster ici un code réel? –
Parce que je ne sais pas écrire le vrai code (PHP). C'est pourquoi je demande ici. – Psyche
En effet - à quoi sert la structure répétitive? Quelle est la différence entre "News 1" la première fois et la deuxième fois? Pourriez-vous imprimer la structure que vous voulez afficher et coller dans la question? – Amadan