Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php function expression($x) { $result = (abs($x-5)-sin($x))/3+(sqrt($x*$x+2014)*cos(2*$x)-3); $result = round($result, 5); return $result; } ?> <?php if (isset($_POST['x']) and is_numeric($_POST['x'])) { $x = $_POST['x']; } else { $x = 0; } ?> <html> <head> <meta charset="utf8" /> </head> <body> <form method="post"> Введите x <input type="text" name="x" value="<?php echo $x; ?>"> <input type="submit" value="Вычислить"> </form> <div> <?php echo "(|x−5|−sin(x))/3+√x^2+2014⋅cos(2x)−3 = " . expression($x) . "; при x = $x"; ?> </div> </body> </html>
Copy Clear