User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » PHP Trimming Characters from the end of a file Page [1]  
Redtaco4x4
All American
1410 Posts
user info
edit post

I have a text file called say "file.txt" and I'm writing a small PHP script to open the file and write stuff in it. Well, this first part works great, but not exactly how I want it. I need to remove the last 2 characters from the end of the file and then add what I need to the file for it to work. Can this be done with the trim function? If so, how should it be formatted? Thanks!

3/8/2006 2:57:05 PM

Stein
All American
19842 Posts
user info
edit post

Look up:

file_get_contents()
substr()
fopen/fputs/fclose

3/8/2006 3:18:54 PM

 Message Boards » Tech Talk » PHP Trimming Characters from the end of a file Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.