I need a script like this : $nom$i = $val["nom"];
See, this provide almost no information. Do you really expect people to divine into your intentions?
Here's my only stab at it (using variable variables):
${$nom.$i} = $val["nom"];