Seriously, this thread has been derailed a bit, wouldn't you all agree. The original poster asked how one would go about writing a PHP calculator for a shool project. He mentioned that he was given very little training in PHP and that this is pretty much his first experience with it.
I would agree that we should not be writing this code for him, regardless of our position on the decay of education in our countries or how we feel about what teachers are asking students to do. The OP asked a question, we all pitched in a little bit, threw out ideas and suggestions. Shouldn't we now let the student try some of the things we suggested and see if he can't come up with something on his own... the way it was intended for his project?
This is just a thought of mine. I don't mean to be a killjoy, party-pooping, fuddy-duddy.