IT Community - Software Programming, Web Development and Technical Support

File Handling in PHP

This is a discussion on File Handling in PHP within the PHP Programming forums, part of the Web Development category; $fh = fopen("myfile", "rb"); $data = fread($fh, filesize("myfile")); fclose($fh); Assuming that the ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #21 (permalink)  
Old 09-12-2007, 11:46 PM
Sivamurugan Sivamurugan is offline
D-Web Trainee
 
Join Date: Mar 2007
Posts: 22
Sivamurugan is on a distinguished road
Default Re: How To Read the Entire File into a Single String?

$fh = fopen("myfile", "rb");
$data = fread($fh, filesize("myfile"));
fclose($fh);

Assuming that the file is no bigger than 8 KB, the code below should read the entire file into a string.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby File handling shaalini Ruby 3 03-29-2008 12:19 AM
File extension of the code file & object repository file in QTP vigneshgets Testing Tools 1 01-16-2008 11:43 PM
Image handling in php varghese PHP Programming 75 11-12-2007 09:58 PM
How can I do error handling in php? itbarota PHP Programming 1 09-12-2007 03:56 AM
Error Handling vigneshgets Software Testing 0 05-18-2007 03:36 AM


All times are GMT -7. The time now is 02:32 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0