Afficher les valeur d'un array dans un array

Fermé
alitpsa Messages postés 289 Date d'inscription mercredi 7 novembre 2007 Statut Membre Dernière intervention 14 décembre 2012 - 1 sept. 2008 à 12:03
dreamfeeder Messages postés 253 Date d'inscription samedi 24 novembre 2007 Statut Membre Dernière intervention 25 juillet 2009 - 1 sept. 2008 à 14:16
salut a tous et merci de votre aide d'avance !
j'ai un gros pb pour afficher les valeur d'un array dans array voila le code :
Code : PHP

<?
$last_news_title = array (
0 =>
array (
0 => '45654', /*c'est l'ID*/
1 => 'Napster bientôt à vendre ?',/* le titre */
2 => 1220258880,/* le time stamp */
3 => '25',/* le numero de la rubrique */
4 => '45654-Napster-MP3-Amazon-Rhapsody-iTunes', /* sous titre */
),
1 =>
array (
0 => '45653',
1 => 'Le C728, le GPS de Mio devient télévision dans les bouchons',
2 => 1220258465,
3 => '50',
4 => '45653-Mio-C728-GPS-television-guidage',
),
2 =>
array (
0 => '45652',
1 => 'Des images toujours plus fines dans Google Earth et Maps',
2 => 1220257501,
3 => '25',
4 => '45652-geoeye-google-maps-earth-satellite',
),
3 =>
array (
0 => '45651',
1 => 'Microsoft travaille sur Vi-Fi, du Wi-Fi pour les voitures',
2 => 1220257097,
3 => '24',
4 => '45651-WiFi-Microsoft-campus-deplacement-couverture',
),
4 =>
array (
0 => '45650',
1 => '4ème licence 3G : Martin Bouygues ne craint pas Free',
2 => 1220256005,
3 => '63',
4 => '45650-Martin-Bouygues-Iliad-Free-3G',
),
5 =>
array (
0 => '45649',
1 => 'Brèves : HTC Dream en photos, Microsoft Skymarket, Atom limités',
2 => 1220254576,
3 => '50',
4 => '45649-breves-HTC-Dream-Microsoft-Skymarket-Atom-In',
),
6 =>
array (
0 => '45648',
1 => 'Piratage, label Presse sur Internet : Albanel bogue en touche',
2 => 1220252753,
3 => '12',
4 => '45648-piratage-olivennes-hadopi-label-albanel',
),
);
?>
<?
$rubriques = array();
$rubriques[] = array(0,'Divers');
$rubriques[] = array(1,'Logiciels');
$rubriques[] = array(2,'Carte mère');
$rubriques[] = array(3,'Carte graphique');
$rubriques[] = array(4,'Graveur');
$rubriques[] = array(5,'Boîtier');
$rubriques[] = array(6,'Lecteur');
$rubriques[] = array(7,'Stockage');
$rubriques[] = array(8,'Tuning');
$rubriques[] = array(9,'Refroidissement');
$rubriques[] = array(10,'The Inquirerisation');
$rubriques[] = array(11,'Ecran');
$rubriques[] = array(12,'Humour');
$rubriques[] = array(13,'Clavier');
$rubriques[] = array(14,'Souris');
$rubriques[] = array(16,'Processeur');
$rubriques[] = array(17,'Mémoire');
$rubriques[] = array(18,'Carte son');
$rubriques[] = array(19,'Haut-parleur');
$rubriques[] = array(20,'Nouvelle technologie');
$rubriques[] = array(21,'BIOS / Pilotes');
$rubriques[] = array(22,'Astuces');
$rubriques[] = array(24,'Sans fil');
$rubriques[] = array(25,'Internet');
$rubriques[] = array(26,'Imprimante');
$rubriques[] = array(27,'Concours');
$rubriques[] = array(28,'PC INpact');
$rubriques[] = array(29,'Ordinateur portable');
$rubriques[] = array(31,'Mini PC');
$rubriques[] = array(32,'Rumeur');
$rubriques[] = array(33,'Modem');
$rubriques[] = array(34,'Apple');
$rubriques[] = array(35,'Pirate');
$rubriques[] = array(36,'Overclocking');
$rubriques[] = array(37,'Faille de sécurité');
$rubriques[] = array(38,'Solidarité');
$rubriques[] = array(39,'Espionnage');
$rubriques[] = array(40,'Disque dur');
$rubriques[] = array(41,'Finances - Sociétés');
$rubriques[] = array(42,'Chipset');
$rubriques[] = array(43,'Lecteur multimédia');
$rubriques[] = array(44,'Serveur');
$rubriques[] = array(45,'Baisse de prix');
$rubriques[] = array(47,'Console de jeux');
$rubriques[] = array(48,'Alimentation');
$rubriques[] = array(49,'PC');
$rubriques[] = array(50,'Accessoire');
$rubriques[] = array(52,'Réseau');
$rubriques[] = array(53,'PDA / Smartphone');
$rubriques[] = array(54,'Tablette PC');
$rubriques[] = array(55,'Mémoire RAM');
$rubriques[] = array(56,'Appareil photo numérique');
$rubriques[] = array(57,'Jeux vidéo');
$rubriques[] = array(58,'Faits divers');
$rubriques[] = array(59,'Justice');
$rubriques[] = array(60,'Navigateur');
$rubriques[] = array(61,'Peer to peer');
$rubriques[] = array(62,'Malware');
$rubriques[] = array(63,'Téléphonie');
$rubriques[] = array(64,'The Bogue');
$rubriques[] = array(65,'Système d\'exploitation');
$rubriques[] = array(66,'Sécurité');
$rubriques[] = array(67,'Fake');
$rubriques[] = array(68,'Barebone');
$rubriques[] = array(69,'INpact Virtuel');
$rubriques[] = array(70,'CeBIT');
$rubriques[] = array(71,'Droit');
$rubriques[] = array(72,'MedPi');
$rubriques[] = array(73,'VOD');
$rubriques[] = array(74,'Environnement');
$rubriques[] = array(75,'IDF');
$rubriques[] = array(76,'Dessin');

?>



le but et d'afficher a la fin quelque chose comme ca :
Napster bientôt à vendre ? (Internet)

je présise que je n'estr besoin que du titre et le nom de la rubrique

merci !
A voir également:

1 réponse

dreamfeeder Messages postés 253 Date d'inscription samedi 24 novembre 2007 Statut Membre Dernière intervention 25 juillet 2009 54
1 sept. 2008 à 14:16
<?
foreach($last_news_title as $news)
{
$idRub=$news[3];

foreach($rubriques as $cat)
{
if($cat[0]==$idRub)
{
$rub=$cat[1];
}
}

echo "$news[1] ";
echo "($rub)";
echo "<br />";
}

?>
1

Discussions similaires