Re: One additional thought
| From: | Joshua May | Date: | Tue, 13 Sep 2005 07:03:10 +0000 |
| Subject: | Re: One additional thought | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-40254@lists.php.net to get a copy of this message | ||
to write files, you could use file_put_contents (if you're using php5)
which really simplifies the process.
you might want to check out file_get_contents, too, to streamline your
file reading process, so you don't have to loop the array.
to loop each directory, have a look at the readdir function.. throw in a
bit of recursion, and bob's your uncle. for real.
josh.
Ron Piggott wrote:
I have this PHP code below that loads a web page into the "$message" variable $lineArray = file($web_page); // make an empty variable first $message = ""; // concat all array element foreach($lineArray as $eachLine) { $message .= $eachLine; } $additional_text = "blah blah blah"; $message = $additional_text . $message; and then write that to a file. I do not know the command to write it to a file. And I need to make this edit to each and every HTML file within my site === I am not sure how to tell the computer to open up each file within each directory. Ron