This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

php incrementing grades in a file

 
daniel kidanee
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am new to php and I am trying to do the following task. I fill I am doing it the longer way.
even, it is not working. Can any one help recommend an easy way of doing it? thank you!
Task

Your task is to write a PHP script that reads grades from the file grades.txt, increments the grades by one and writes the incremented
grades to the file results.txt and finally prints the grades from results.txt. If the grade is five, it won't be incremented. The grades in
grades.txt are each in its own row and the amount of digits in a grade may vary. The grades are between 0-5. The grades written in
results.txt should each also be in their own rows.

Example output



My code:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic