Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2006
    Thanked 0 Times in 0 Posts

    Question How to make function to read TXT file and modify?

    I would like to read file on server's folder and modify LIST
    with convert to Lowercase and Uppercase and first letters to Uppercase.

    As there will be many functions of modification how to do with functions for each modification?

  2. #2
    Codeasaurus Rex
    Join Date
    Jun 2008
    Redmond, WA
    Thanked 100 Times in 94 Posts
    Okay, unfortunately I had trouble understanding your post so this may not be what you're looking for.

    You will need:
    fopen(); - Opens file or URL
    fclose(); - Closes an open file pointer
    strtoupper(); - Makes an entire string uppercase
    strtolower(); - Makes an entire string lowercase
    ucfirst(); - Makes the first character in a string uppercase
    lcfirst(); - Makes the first character in a string lowercase

    Be sure to check out the examples given for all of these functions so you can see how to utilize them.

    Using the above functions you'll be able to create a script that opens a file, and, using a loop in conjunction with the above string functions, performs your modifications.
    Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
    My posts, comments, code, and suggestions reflect only my personal views.
    Web Portfolio and Code Snippets: http://shanechism.com


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts