Learning PHP and MySQL
Example 04-08 Using the ? operator to create a message
<?php
$logged_in = TRUE;
$user = "Admin";
$banner = ($logged_in==TRUE)?"Welcome back $user!":"Please login.";
echo "$banner";
?>
Posted by on 08/03 at 08:12 AM
Next entry: Example 04-09 Using if to test for multiple values
Previous entry: Example 04-07 Checking multiple conditions