1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

PHP Parsing/File Editing

Discussion in 'Web Design & Development' started by rabidroach90, Feb 2, 2007.

Thread Status:
Not open for further replies.
  1. rabidroach90

    rabidroach90 Thread Starter

    Nov 15, 2006

    So, I have this website (whoa, who would have guessed). There's a section where people can sign up for events, etc. Upon hitting the submit button on this form, the data is stored into a flat file database (a simple txt file) and is spat back out at the user in tabular form by parsing the text file.

    My problem, then, is this: I need an efficient way to remove entries from the list. The way I'm doing it right now is through a php in-browser text-editor, but this gets really confusing for those who I work with who aren't as computer savvy. I'm looking essentially for a way for someone to very easily just check off the people that need to be removed from the list, and hit submit.

    EDIT: This may be simpler: Is there a way utilizing PHP to tell a text file to delete line X?

    Any thoughts?
  2. Big-K


    Nov 22, 2003
    I don't know if you can delete by line number, but one way (granted, its a bit unreliable) is to tell it to replace the text of that line with "". For instance if the entry is 'John Smith' and there will be a line that says $name1 = "John Smith";, you could use something like this:

    str_replace("\$name1 = \"John Smith\";", "", $file);
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/540554

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice