PHP rename.
Posted: Fri May 22, 2009 12:54 pm
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?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
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