Reply to Re: writing to a specific place in a file

Your name:

Reply:


Posted by Arjen on 06/12/06 14:42

laredotornado@zipmail.com schreef:
> Hello,
>
> I have a text file. I would like to write a line of data as the first
> line and then another as the last line. What is the easiest way to do
> this using php 4?
>
> Thanks, - Dave
>
$oldtext = file_get_contents("a.txt");

$firstline = "";
$lastline = "";

$newtext = $firstline.$oldtext.$lastline;

And the save the text in the file

take a look at

http://php.net/manual/nl/function.fopen.php

Arjen

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация