- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
sqrt() function in PHP
The sqrt() function Returns the square root of a number.
Syntax
sqrt(num)
Parameters
num − The number for which you want to find the square root
Return
The sqrt() function Returns the square root of the specified number.
Example
<?php echo(sqrt(16)); ?>
Output
4
Example
Let us see another example −
<?php echo(sqrt(0.25) . "<br>"); ?>
Output
0.5<br>
Example
Let us see another example −
<?php echo(sqrt(-144)); ?>
Output
NAN
- Related Articles
- PHP sqrt() Function
- strcmp() function in PHP
- strcoll() function in PHP
- strcspn() function in PHP
- strip_tags() function in PHP
- stripcslashes() function in PHP
- stripos() function in PHP()
- stristr() function in PHP
- stripslashes() function in PHP
- strlen() function in PHP
- strnatcasecmp() function in PHP
- strnatcmp() function in PHP
- strncasecmp() function in PHP
- strncmp() function in PHP
- strpbrk() function in PHP

Advertisements