Using the ? Operator : URL Redirect « Network « PHP






Using the ? Operator

<html>
<head>
<title>Using the ? Operator</title>
</head>
<body>
<?php
$mood = "sad";
$text = ( $mood=="happy" ) ? "a good mood" : "Not happy but $mood";
print "$text";
?>
</body>
</html>

           
       








Related examples in the same category

1.Redirect to a URL