crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Common PHP function with code
Question Posted on 23 Mar 2019Home >> PHP >> Example >> Common PHP function with code

Common PHP function with code
Below are the diferent PHP function with example and output
(1)is_number
it is used to check value is numeric or not
Code:-
< ?php
if(is_numeric("crackyourinterview"))
{
echo "true";
}
else
{
echo "false";
}
?>
Output:-False

(2)number_format
used to separate digit and decimal parts
Code
< ?php
echo number_format(1124563);
? >
Output:-1,124,563

(3)rand
Used to generate a random number
Code:-
< ?php
echo rand();
?>
Output:- Random Number

(4)round
Round off a number with decimal points to nearest whole number
Code:-
< ?php
echo round(56.23);
?>
Output:-56

(5)sqrt
Return the square root of a number
Code:-
< ?php
echo sqrt(81);
?>
Output:-9

(5)cos
Return the cosine
Code:-
echo cos(45);
?>
Output:-0.52532198881773

(6)sin
Return the sine
Code:-
< ?php
echo sin(45);
?>
Output:-0.85090352453412

(7)tab
Return the tangent
Code:-
< ?php
echo tan(45);
?>
Output:-1.6197751905439

(8)pi
Returns the value of PI
Code:-
< ?php
echo pi();
?>
Output:-3.1415926535898
0
0



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

something about array creation sorting searching in php

Remove whitespace from end of string in PHP

difference between htmlentities() and htmlspecialchars()

How to gernate random value in PHP

Number of time a value occur in array in PHP






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap