Thursday, 16 August 2012

PHP Examples - Files And Demo

Program:



<html >
<head>

<title>PHP Example 12 : FILES</title>
</head>

<body>

<?php
 
 echo "PHP Example 12";
 echo"<br/>"; // line break
 echo"<h1>";
 echo"FILES";
 echo"</h1>";
 echo"<br/>";

 $filename="testfile.txt"; // Filename 
 
 $f1=fopen("$filename","w"); // Opening file in write mode
 echo "<br/>testfile.txt created.<br/>";
 fwrite($f1,"www.2k8618.blogspot.com"); // Writing data to file
 echo "<br/>Data written.<br/>";

 fclose($f1); //File closed
// echo "<br/>File closed.<br/>";


 $f2=fopen("$filename","r"); // Opening file in read mode

 $dataop= fread($f2,25); // Data read from file
 
 echo "<br/>Data read.<br/>";
 echo $dataop;
 fclose($f2);
  
 // unlink($filename); // to delete file
 

 echo"<br/>";

 echo "<br/><b>";
 echo"WWW.2K8618.BLOGSPOT.COM";
 echo"</b>";
?>


</body>
</html>
 
Output:
 
 
 

5 comments:

  1. Great detailed information, I ll be visiting you more frequently, here is very interesting information.

    Développement marque sous licence & Agence de merchandising

    ReplyDelete
  2. I liked the content on this site. Would like to visit again.

    IMG & Diventare Licenziatario

    ReplyDelete
  3. This is so impressive and nice title of blog. I am always searching such type of Blog that gave some useful knowledge and relax our mind. So Very thanks for design this type of content and what are you thing at time of write. Thanks for sharing views.

    Fashion Licensing & Become a Licensee

    ReplyDelete
  4. Please keep sharing more and more information about this.This is a good information of the fashion licensing articles and really like your site.

    Wie bekomme ich eine Lizenz?

    ReplyDelete
  5. I wanted to thank you for this great read!! I definitely enjoying every little bit of it Smile I have you bookmarked to check out new stuff you post.
    Développement marque sous licence & Agence de merchandising

    ReplyDelete