Afficher une variable PHP
17 messages • Page 1 sur 2 • 1, 2
Consultez la formation au référencement naturel Google de WebRankInfo / Ranking Metrics
Afficher une variable PHP
Bonjour
Le resultat affiché d'une variable print_r($tableau); sur mon script donne ceci :
Or, l'information que je cherche à afficher dans tout ce code est celle en 10ème ligne "674.20"
Merci de votre aide
Le resultat affiché d'une variable print_r($tableau); sur mon script donne ceci :
- Code: Tout sélectionner
Array ( [TTI_transmission] => Array ( [quoteresult] => Array ( [0] => Array ( [symbolfound] => 1 [tickersymbol] => $DJI [companyname] => DOW JONES INDUSTRIAL AVERAGE [last] => 12560.20 [change] => +30.15 [pcthange] => +0.24 [volume] => 164,930,779 ) [1] => Array ( [symbolfound] => 1 [tickersymbol] => SPX [companyname] => STANDARD AND POORS 500 INDEX [last] => 1443.76 [change] => +4.39 [pcthange] => +0.30 [volume] => 0 ) [2] => Array ( [symbolfound] => 1 [tickersymbol] => TSEA.CA [companyname] => S&P/TSX COMPOSITE INDEX [last] => 13425.02 [change] => -23.29 [pcthange] => -0.17 [volume] => 0 ) [3] => Array ( [symbolfound] => 1 [tickersymbol] => JX.CA [companyname] => S&P/TSX VENTURE COMPOSITE [last] => 3257.43 [change] => +16.46 [pcthange] => +0.51 [volume] => 0 ) [4] => Array ( [symbolfound] => 1 [tickersymbol] => /GC7J [companyname] => GOLD APRIL [last] => 674.20 [change] => +2.10 [pcthange] => +0.31 [volume] => 1,718 ) [5] => Array ( [symbolfound] => 1 [tickersymbol] => /SI7J [companyname] => SILVER APRIL [last] => 13.694 [change] => +0.124 [pcthange] => +0.91 [volume] => 0 ) [6] => Array ( [symbolfound] => 1 [tickersymbol] => /CL7K [companyname] => CRUDE OIL LT SWEET MAY NT [last] => 63.94 [change] => -0.34 [pcthange] => -0.53 [volume] => 180,648 ) [7] => Array ( [symbolfound] => 1 [tickersymbol] => /NG7K [companyname] => HENRY hub NAT GAS MAY NT [last] => 7.625 [change] => +0.018 [pcthange] => +0.24 [volume] => 35,260 ) [8] => Array ( [symbolfound] => 1 [tickersymbol] => /HG7J [companyname] => COPPER APRIL [last] => 3.371 [change] => -0.0115 [pcthange] => -0.34 [volume] => 304 ) [9] => Array ( [symbolfound] => 1 [tickersymbol] => /PL7J [companyname] => PLATINUM APRIL NT [last] => 1261.00 [change] => -1.90 [pcthange] => -0.15 [volume] => 24 ) [10] => Array ( [symbolfound] => 1 [tickersymbol] => /PA7J [companyname] => PALLADIUM APRIL NT [last] => 0.00 [change] => 0.00 [pcthange] => 0.00 [volume] => 0 ) [11] => Array ( [symbolfound] => 1 [tickersymbol] => /QL7K [companyname] => COAL MAY NT [last] => 41.25 [change] => 0.00 [pcthange] => 0.00 [volume] => 0 ) ) [datestamp] => Friday, April 6, 2:01 PM ) )
Or, l'information que je cherche à afficher dans tout ce code est celle en 10ème ligne "674.20"
Merci de votre aide
Dernière édition par rasheed le Ven Avr 06, 2007 20:44, édité 1 fois.
-

phpmikedu83 - WRInaute accro

- Messages: 1281
- Inscription: Sam Aoû 06, 2005 7:34
rasheed a écrit:Bonjour
A quoi cela va servir !
Merci
A afficher le contenu de ton tableau de manière lisible lol
ah je viens de tester
L'affichage s'amèliore mais ce n'est toujours pas ce que je cherche
, je veux afficher rien que "674.20" (qui se trouve sur [4] => Array).
Comment puis je tirer cette information depuis tout ce code !
--------------------------------------------------------
Array
(
[TTI_transmission] => Array
(
[quoteresult] => Array
(
[0] => Array
(
[symbolfound] => 1
[tickersymbol] => $DJI
[companyname] => DOW JONES INDUSTRIAL AVERAGE
[last] => 12560.20
[change] => +30.15
[pcthange] => +0.24
[volume] => 164,930,779
)
[1] => Array
(
[symbolfound] => 1
[tickersymbol] => SPX
[companyname] => STANDARD AND POORS 500 INDEX
[last] => 1443.76
[change] => +4.39
[pcthange] => +0.30
[volume] => 0
)
[2] => Array
(
[symbolfound] => 1
[tickersymbol] => TSEA.CA
[companyname] => S&P/TSX COMPOSITE INDEX
[last] => 13425.02
[change] => -23.29
[pcthange] => -0.17
[volume] => 0
)
[3] => Array
(
[symbolfound] => 1
[tickersymbol] => JX.CA
[companyname] => S&P/TSX VENTURE COMPOSITE
[last] => 3257.43
[change] => +16.46
[pcthange] => +0.51
[volume] => 0
)
[4] => Array
(
[symbolfound] => 1
[tickersymbol] => /GC7J
[companyname] => GOLD APRIL
[last] => 674.20
[change] => +2.10
[pcthange] => +0.31
[volume] => 1,718
)
[5] => Array
(
[symbolfound] => 1
[tickersymbol] => /SI7J
[companyname] => SILVER APRIL
[last] => 13.694
[change] => +0.124
[pcthange] => +0.91
[volume] => 0
)
[6] => Array
(
[symbolfound] => 1
[tickersymbol] => /CL7K
[companyname] => CRUDE OIL LT SWEET MAY
[last] => 64.28
[change] => -0.10
[pcthange] => -0.15
[volume] => 1,188
)
[7] => Array
(
[symbolfound] => 1
[tickersymbol] => /NG7K
[companyname] => HENRY hub NAT GAS MAY
[last] => 7.607
[change] => +0.092
[pcthange] => +1.22
[volume] => 750
)
[8] => Array
(
[symbolfound] => 1
[tickersymbol] => /HG7J
[companyname] => COPPER APRIL
[last] => 3.371
[change] => -0.0115
[pcthange] => -0.34
[volume] => 304
)
[9] => Array
(
[symbolfound] => 1
[tickersymbol] => /PL7J
[companyname] => PLATINUM APRIL NT
[last] => 1261.00
[change] => -1.90
[pcthange] => -0.15
[volume] => 24
)
[10] => Array
(
[symbolfound] => 1
[tickersymbol] => /PA7J
[companyname] => PALLADIUM APRIL NT
[last] => 0.00
[change] => 0.00
[pcthange] => 0.00
[volume] => 0
)
[11] => Array
(
[symbolfound] => 1
[tickersymbol] => /QL7K
[companyname] => COAL MAY NT
[last] => 41.25
[change] => 0.00
[pcthange] => 0.00
[volume] => 0
)
)
[datestamp] => Friday, April 6, 3:45 PM
)
)
----------------------------------------------------------
Merci
L'affichage s'amèliore mais ce n'est toujours pas ce que je cherche
Comment puis je tirer cette information depuis tout ce code !
--------------------------------------------------------
Array
(
[TTI_transmission] => Array
(
[quoteresult] => Array
(
[0] => Array
(
[symbolfound] => 1
[tickersymbol] => $DJI
[companyname] => DOW JONES INDUSTRIAL AVERAGE
[last] => 12560.20
[change] => +30.15
[pcthange] => +0.24
[volume] => 164,930,779
)
[1] => Array
(
[symbolfound] => 1
[tickersymbol] => SPX
[companyname] => STANDARD AND POORS 500 INDEX
[last] => 1443.76
[change] => +4.39
[pcthange] => +0.30
[volume] => 0
)
[2] => Array
(
[symbolfound] => 1
[tickersymbol] => TSEA.CA
[companyname] => S&P/TSX COMPOSITE INDEX
[last] => 13425.02
[change] => -23.29
[pcthange] => -0.17
[volume] => 0
)
[3] => Array
(
[symbolfound] => 1
[tickersymbol] => JX.CA
[companyname] => S&P/TSX VENTURE COMPOSITE
[last] => 3257.43
[change] => +16.46
[pcthange] => +0.51
[volume] => 0
)
[4] => Array
(
[symbolfound] => 1
[tickersymbol] => /GC7J
[companyname] => GOLD APRIL
[last] => 674.20
[change] => +2.10
[pcthange] => +0.31
[volume] => 1,718
)
[5] => Array
(
[symbolfound] => 1
[tickersymbol] => /SI7J
[companyname] => SILVER APRIL
[last] => 13.694
[change] => +0.124
[pcthange] => +0.91
[volume] => 0
)
[6] => Array
(
[symbolfound] => 1
[tickersymbol] => /CL7K
[companyname] => CRUDE OIL LT SWEET MAY
[last] => 64.28
[change] => -0.10
[pcthange] => -0.15
[volume] => 1,188
)
[7] => Array
(
[symbolfound] => 1
[tickersymbol] => /NG7K
[companyname] => HENRY hub NAT GAS MAY
[last] => 7.607
[change] => +0.092
[pcthange] => +1.22
[volume] => 750
)
[8] => Array
(
[symbolfound] => 1
[tickersymbol] => /HG7J
[companyname] => COPPER APRIL
[last] => 3.371
[change] => -0.0115
[pcthange] => -0.34
[volume] => 304
)
[9] => Array
(
[symbolfound] => 1
[tickersymbol] => /PL7J
[companyname] => PLATINUM APRIL NT
[last] => 1261.00
[change] => -1.90
[pcthange] => -0.15
[volume] => 24
)
[10] => Array
(
[symbolfound] => 1
[tickersymbol] => /PA7J
[companyname] => PALLADIUM APRIL NT
[last] => 0.00
[change] => 0.00
[pcthange] => 0.00
[volume] => 0
)
[11] => Array
(
[symbolfound] => 1
[tickersymbol] => /QL7K
[companyname] => COAL MAY NT
[last] => 41.25
[change] => 0.00
[pcthange] => 0.00
[volume] => 0
)
)
[datestamp] => Friday, April 6, 3:45 PM
)
)
----------------------------------------------------------
Merci
-

phpmikedu83 - WRInaute accro

- Messages: 1281
- Inscription: Sam Aoû 06, 2005 7:34
et:
C'est pas mieux?...
- Code: Tout sélectionner
echo $tableau['TTI_transmission']['quoteresult'][4]['last'];
C'est pas mieux?...
phpmikedu83 a écrit:et:
- Code: Tout sélectionner
echo $tableau['TTI_transmission']['quoteresult'][4]['last'];
C'est pas mieux?...
Cela n'affiche rien non plus
-

phpmikedu83 - WRInaute accro

- Messages: 1281
- Inscription: Sam Aoû 06, 2005 7:34
- Code: Tout sélectionner
echo '<pre><b>TTI_transmission</b><br>';
print_r($tableau['TTI_transmission']);
echo '<br><br><b>TTI_transmission / quoteresult</b><br>';
print_r($tableau['TTI_transmission']['quoteresult']);
echo '</pre>';
bon ben, qu'est-ce que ça affiche?
phpmikedu83 a écrit:et:
- Code: Tout sélectionner
echo $tableau['TTI_transmission']['quoteresult'][4]['last'];
C'est pas mieux?...
phpmikedu83, je pense que vous avez édité votre message, au moment ou je répondais, votre code proposé étais $tableau[4]['last'] et c'est à ce message que je voulais répondre comme quoi ça n'a pas marché
Maintenant pour echo $tableau['TTI_transmission']['quoteresult'][4]['last']; ça maaaaaaarche.
YoyoS, phpmikedu83, merci mille et une fois
-

phpmikedu83 - WRInaute accro

- Messages: 1281
- Inscription: Sam Aoû 06, 2005 7:34
YoyoS a écrit:a oufje voyais pu de possibilité ^^
Moi non plus, je comprenais plus là
17 messages • Page 1 sur 2 • 1, 2
Formation recommandée sur ce thème :
Formation Référencement naturel Google : apprenez une méthode efficace pour optimiser à fond le référencement naturel dans Google de façon durable... Formation animée par Olivier Duffez et Fabien Facériès, experts en référencement naturel.
Tous les détails sur le site Ranking Metrics : programme, prix, dates et lieux, inscription en ligne.
Lectures recommandées sur ce thème :
- Tous les raccourcis-clavier de Google Chrome (shortcuts)
- Présentation de Google AdSense
- Google AdSense en test sur WebRankInfo
- Une icone pour afficher des plans dans les résultats de Google (Plus Box)
- Configurer des nouveaux moteurs dans Google Analytics
- Exclure son propre trafic de Google Analytics
- Google veut-il dépasser les 20 milliards de pages de Yahoo ?
- Ecrire un sitemap pour Google News
- Yahoo France propose des requêtes avec les recherches suggérées
- La commande site: dans Google
Qui est en ligne
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 0 invités

le forum