<html>
<head>
<title>Arithmetical Operators</title>
</head>
<body>
<?php
a = 10;b = 20;
/* If condition is true then assign a to result otheriwse b */
result = (a > b ) ?a :b;
echo "TEST1 : Value of result isresult<br/>";
/* If condition is true then assign a to result otheriwse b */
result = (a < b ) ?a :b;
echo "TEST2 : Value of result isresult<br/>";
?>
</body>
</html>
HTML
这将产生以下结果−
TEST1 : Value of result is 20
TEST2 : Value of result is 10