Data Types and the If-Else Construct in PHP
When using the if construct,
you can compare strings as well. For example, let the
variable $test store some
string, like this:
<?php
$test = 'abc';
?>
Let's check if the content of the variable
$test is equal to the string 'abc':
<?php
$test = 'abc';
if ($test == 'abc') {
echo '+++'; // this will work, because the variable is equal to 'abc'
} else {
echo '---';
}
?>