Lo intente asi :
Código PHP:
<?php
$file = fopen("img.php", "r");
$archivo = file_get_contents('img.php');
$cadena = str_replace("fondo2","fondo",$archivo);
fwrite($file,$cadena);
fclose($file);
?>
Tampoco me funciono U.u .... No me da ningun error ... solo no reemplaza el texto =S
Y el file_put_constents no lo entiendo :X