I want to develop one simple api using php.
My functionality is that if some one enter some required values then they will get calculation result from the algorithm
An API is usually something you would create to allow other developers to access your program more easily.
But by the sounds of what you are doing it seems like you just need to make a simple page that performs some calculations and an API may not be necessary for you to do this.
I suggest learning some general PHP tutorials first as well as some for processing forms.