Code: Select all
$h1="hello";
$h2="world";
$i=1;
while($i<=2){
rename("file$i.html", "$h{$i}.php");
$i++;
}They rename to 1.php, and 2.php, what is the proper syntax to grab $h1, and $h2?
Moderator: General Moderators
Code: Select all
$h1="hello";
$h2="world";
$i=1;
while($i<=2){
rename("file$i.html", "$h{$i}.php");
$i++;
}Code: Select all
$h1="hello";
$h2="world";
$i=1;
while($i<=2){
rename("file$i.html", "${'h' . $i}.php");
$i++;
}Thanks.lovelf wrote:Thank you very much, it worked awesome