home *** CD-ROM | disk | FTP | other *** search
- To use this function call it with
-
- $rs = write_file("my_file", "foooo");
- $rs will return 1 on success and 0 on failure.
-
-
-
-
-
- <?PHP
-
- function write_file($filename, $contents) {
-
- if ($fp = fopen($filename, "w")) {
- fputs($fp, $contents, strlen($contents));
- fclose($fp);
- return 1;
- }
- else { return 0; }
-
- }
- ?>
-
- -- Fredrik Steen - PHP/JAVA/LINUX
- nospam@stone.nu
-
- Member of K.L.U.G (Karlstad Linux User group).
- http://www.klug.org
- http://www.stone.nu
-