Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-16-2006, 04:43 PM   #1 (permalink)
 
Newb Techie

Join Date: Oct 2006

Posts: 29

zach014

Default erase from file (php)

is there a way (with php) to erase a line from a file?

zach
zach014 is offline  
Old 10-16-2006, 05:11 PM   #2 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

You could read the contents of the file into a string, remove the line from the string, and overwrite the edited string back to the file.
jaeusm is offline  
Old 10-16-2006, 05:16 PM   #3 (permalink)
 
Newb Techie

Join Date: Oct 2006

Posts: 29

zach014

Default

can you put that in a code example? I'm not entirely sure how to go about doing so.

zach
zach014 is offline  
Old 10-16-2006, 05:25 PM   #4 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Research. Use Google. I won't do the work for you. You need to attempt it yourself. If you run into specific problems, post your code and we'll go over it. The file I/O can be done in a few lines of code. If you're only deleting one line of text, the entire script should probably be no longer than 10 - 20 lines.
jaeusm is offline  
Old 10-16-2006, 07:52 PM   #5 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default

http://php.net manual is awesome
office politics is offline  
Old 10-16-2006, 07:54 PM   #6 (permalink)
 
Newb Techie

Join Date: Oct 2006

Posts: 29

zach014

Default

i'll check it out
zach014 is offline  
 
Closed Thread

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

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