phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


PHP File: Working Easy with File (Read File)

Tag: file, read   Category: PHP Classes
post: 03 Jan 2008 read: 2,248


PHP File Tutorial: This post is a part of file class tutorial series. We will talk about a class that help us manage file very easy. We can read, delete, create, dowload, upload with easy way. For first, we begin how to read a file.

We need a class named "class.file". This class was writen by Antoine Bouet. You can download at phpclasses.org. After download the class (file-2003-03-31.zip), extract to directory www/test/file.

Then create a file named "read.php". This file content codes will read a file. Enter following code:


 <?
 include "class.file.php";
 
 $source = "class.file.php";
 $file   = new file ($source);  
 echo $file ->read();
 
 ?>

In this practice, we try to read its class self. You can try others. Just replace $source = "...".

result of file reading use class.file


Series this article:
PHP File: Working Easy with File (Read File)
PHP File: Working Easy with File (Create and Write)
PHP File: Working Easy with File (Delete File)
PHP File: Working Easy with File (Download)

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
SMS : Sending SMS with PHP and ActiveXperts (Part 1)

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


624
posting