frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

PHP Math

PHP Math

Find the value of PI

<!DOCTYPE html>
<html>
<body>


<?php
echo(pi());
?>


</body>
</html>


Find the lowest and highest value in a list of arguments

<!DOCTYPE html>
<html>
<body>


<?php
echo(min(0, 150, 30, 20, -8, -200) . "<br>");
echo(max(0, 150, 30, 20, -8, -200));
?>


</body>
</html>


Find the absolute (positive) value of a number

<!DOCTYPE html>
<html>
<body>


<?php
echo(abs(-6.7));
?>


</body>
</html>


Find the square root of a number

<!DOCTYPE html>
<html>
<body>


<?php
echo(abs(-6.7));
?>


</body>
</html>


Round a floating-point number to its nearest integer

<!DOCTYPE html>
<html>
<body>


<?php
echo(round(0.60) . "<br>");
echo(round(0.50) . "<br>");
echo(round(0.49) . "<br>");
echo(round(-4.40) . "<br>");
echo(round(-4.60));
?>


</body>
</html>


Generate a random number

<!DOCTYPE html>
<html>
<body>


<?php
echo(rand());
?>


</body>
</html>


Generate a random number between 10 and 100

<!DOCTYPE html>
<html>
<body>

<?php
echo(rand(10, 100));
?>

</body>
</html>
Tagged:
Sign In or Register to comment.

Developer

| make vanilla clean and light
@ 2016 Your Sitename, All rights reserved. Material Design is a design language developed by Google. Material Design makes more liberal use of grid-based layouts and responsive animations and transitions.
Powered by VanillaForums, Designed by ThemeSteam

Contact us

info@example.com
support@example.com
(800) 3032120

Get In Touch