<? $table[1] = 'ceci'; $table[2] = 'est'; $table[3] = 'un'; $table[4] = 'test'; function truc() { global $table; foreach($table as $index => $value) { machin(); echo $value.' '; } } function machin() { global $table; foreach($table as $index => $value) { // Aucun code, mais c'est juste pour l'exemple ! } } truc(); ?>
function truc() { global $table; $table2 = $table; foreach($table2 as $index => $value) { machin(); echo $value.' '; } }
Web analytics