General Statistics
390 Tutorials
202 Total Votes
7 User(s) Online
975359 Views Total
3000 Registered Members
24734 Posts Total
Rooneyfeld is our newest member
About this Tutorial: Creating your Own Configuration File
Creating your Own Configuration File
Rated 4 / 1 Votes

Creating your Own Configuration File

Storing information has never became so fun. Set information in a php file with settings to use later without you ever editing the file by hand!


Date Added: November 20, 2005 [ 12365 Views - 1 Votes ] [ Rate ]

Author: Chaos King [ PHP Coding ] [ 3 Comment(s) ]

Creating your Own Configuration File


CODE
$fp = fopen($file_to_write, 'w');
fwrite($fp, $content);
fclose($fp);
echo "Successn";
echo "$file_to_writen";
echo "Has been written";
}



CODE
$fp = fopen($file_to_write, 'w');
That is opening the file which is $file_to_write and in mode w check out http://us3.php.net/fopen for more modes in which to use with files.



CODE
fwrite($fp, $content);
fclose($fp);
That is saying to write the content insidet he file. Then it is closing the opening of the file and what not.



CODE
echo "Successn";
echo "$file_to_writen";
echo "Has been written";
}
That is giving a success message that it is all good.

You should try experimenting with these small little functions built right into php. They can come in handy at points during your coding experience.

Total Pages (4)
<<Prev 1 2 3 [4] 

Welcome User
Welcome Guest
( Login | Register )

Latest Tutorial Index - RSS Feed
Latest Resources - RSS Feed
Latest Tutorials - RSS Feed
Vote for Us
  • VixxIMG.com - Free Image Hosting, Free Myspace Image Hosting, Free Image Uploads
  • PageRank Plus - Google PageRank checking, with a twist.
Random Affilaites