Basically what I\'m looking for is the PHP version of this thread: Find, replace, and increment at each occurence of string
I would like to replace the keyword follow
If I understood your question properly...
$fV) $new[] = (substr($fV, 0, 1)==">")? str_replace("num", $fK/2, $fV) : $fV;
//optionally print it out in the browser.
echo "";
print_r($new);
echo "
";
//optionally write to file...
$output = fopen("output.txt", 'w');
foreach($new as $n) fwrite($output, $n);
fclose($output);