Pb fonction et return [Résolu/Fermé]
Signaler
thomas3347
thomas3347
- Messages postés
- 18
- Date d'inscription
- vendredi 7 septembre 2007
- Statut
- Membre
- Dernière intervention
- 6 novembre 2010
thomas3347
- Messages postés
- 18
- Date d'inscription
- vendredi 7 septembre 2007
- Statut
- Membre
- Dernière intervention
- 6 novembre 2010
A voir également:
- Pb fonction et return
- Fonction return c ✓ - Forum - C
- Fonction return javascript ne fonctionne pas ✓ - Forum - Javascript
- Fonction return ✓ - Forum - Python
- La fonction return ✓ - Forum - Java
- Fonction vba return - Forum - VB / VBA
2 réponses
Dalida
- Messages postés
- 6728
- Date d'inscription
- mardi 14 mai 2002
- Statut
- Contributeur
- Dernière intervention
- 11 janvier 2016
salut,
il faut soit passer ton tableau par référence (le "&"), soit assigné la nouvelle valeur à ta variable.
OU :
il faut soit passer ton tableau par référence (le "&"), soit assigné la nouvelle valeur à ta variable.
function calcul_perf(&$fir, $adv) { $fir['perf'] = '8'; return ($fir); } calcul_perf($joueur1, $joueur2); print_r($joueur1);
OU :
function calcul_perf($fir, $adv) { $fir['perf'] = '8'; return ($fir); } $joueur1 = calcul_perf($joueur1, $joueur2); print_r($joueur1);