News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Richard Heyes' Blog:
Reading a specific line in a file
April 07, 2008 @ 12:56:08

Richard Heyes has thrown together some code for a simple thing that he's seen developers request over and over again - moving to/reading from a specific line in a file.

After reading something on the php-general list I decided that a) I'm bored, and b) I'll write something which handles it. So here it is.

His code is simple - looping through the lines of the file until it locates your desired target (with some error checking along the way). Plus, if it's already fetched, it keeps it in a cached array for future retrieval.

1 comment voice your opinion now!
reading specific file line example class


blog comments powered by Disqus

Similar Posts

David Goodwin's Blog: Book Review: Object-Orientated Programming with PHP5 (Hasin Hayder, Packt)

Zend Developer Zone: Decorators with Zend_Form

Matthew Weir O'Phinney's Blog: exuberant ctags with PHP in Vim

Chris Hartjes' Blog: The Devilís In The Details (or, Handling Sequences in Postgres in CakePHP)

Kevin van Zonneveld's Blog: Convert anything to Tree Structures in PHP


Community Events





Don't see your event here?
Let us know!


podcast release laravel code wordpress api threedevsandamaybe bugfix install library developer framework language application configure list introduction interview community series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework