If I want to open a file and write on it, I can just do this:
$fp = fopen("newfile.file", "a") or die("Couldn't create new file");
$numBytes = fwrite($fp, "\r\nLook, it's a brand new line!");
fclose($fp);
echo "Wrote $numBytes bytes to the end of newfile.file!";
But what if I wanted to open a connect file for a database, like this:
<?
$dbh = mysql_connect ("path/to/sql", "username", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("database");
?>
and I wanted to change the path, username, password, and database. How can I "find" that in the file, then replace it?