Home / PHP Tips Generated By ChatGPT / Calculating the Square Root of a Number in PHP Use sqrt() to calculate the square root of a given number. Source Code echo sqrt(16); // Outputs: 4