Hi E's, in my site http://rdsrc.us/fCIeXk
, I have lots of folders, and each folder represent one city. Inside of each folder I have on file that calls index.htm. In each index.htm I want to substitute some lines of code to others, in practice I want substitute the actual code of counter to the google analytic system.
In practice I have to erase the code between lines 211 to 223, and write the code of google analytics, that you can see in snippet code, before close </head>, and in this case the </head> it is in the line 24, so the line 23 is where I will put the code of google analytics, off course without erase the actual line 23.
I already have the solution to list all the folders, but I need help to edit all the files index.htm inside of each folder like I tell above:
// WHAT DIRECTORY?
$dir = getcwd();
// READ THE CURRENT WORKING DIRECTORY
if ($dh = opendir($dir))
while (($file = readdir($dh)) !== false)
??????EDIT THE FILE INDEX.HTM, ERASE SOME CODE AND PUT A NEW CODE????
How I edit every files index.htm?
The best regards, JC