I'd suggest you learn in this order:
- General PHP Syntax and Structure (See PHP Manual)
- Form posting and value retrieval
- Mathematical operators
Those are the basics to do a general PHP calculator. From your examples, that's all these are. You input a form, it calculates based upon preset numbers, or other numbers in your form, then displays the answers along with the form again. Read through some basic tutorials, and if you need help stepping along the way, feel free to stop back and ask for guidance.