note 48802 deleted from function.fputs by nlopess

From: Date: Fri, 07 Jan 2005 13:59:01 +0000
Subject: note 48802 deleted from function.fputs by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-82902@lists.php.net to get a copy of this message
Note Submitter: hellsid3r at swissonline dot ch Reason: useless example ---- This is an example to write a config to include it in another file <?php // $datei need's CHMOD 777 $datei = "file.txt"; // w+ for open, read first and write the whole file new $handle = fopen($datei, "w+"); fputs($handle, "<"."?"."php \n"); fputs($handle, "\$foo1 = \"$bar1\";\n"); fputs($handle, "\$foo2 = \"$bar2\";\n"); fputs($handle, "\$foo3 = \"$bar3\";\n"); fputs($handle, "\$foo4 = \"$bar4\";\n"); fputs($handle, "?".">"); // Closing file.txt fclose($handle); ?> This code write this in file.txt: <?php $foo1 = "$bar1"; $foo2 = "$bar2"; $foo3 = "$bar3"; $foo4 = "$bar4"; ?> You can now simple include this file. It's very nice to work with txt Databases

« previous php.notes (#82902) next »