Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-21-2009, 08:44 PM #1
- Join Date
- May 2006
- Thanked 0 Times in 0 Posts
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?
03-22-2009, 01:57 AM #2
- 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