ok I get it, but lets say I have button for sqrt which will add the sqrt symbol in the input area . but how do I exactly compute the sqrt if inside the input is the symbol.
you can't use the symbol.
you just use sqrt().
If you want a visual, use the html character number for the symbol, but don't use this in the calculation.
alternatively, use pow($number,0.5), but that isn't an improvement.
You can't read the input box and get php to evaluate it, you'll need to use substitution and possibly reorganization to get it to work.