
A lot can be done with a basic if statement, this is why it is so important to programmers. its boils down to basic logic. “if something is true then do it., if not do something else.”
here is a quick example:
$name = "Adam";
if ( $name == "Adam" ) {
echo "Hello Adam!"; }
echo "Welcome to my homepage!";
This is what would display:
Hello Adam!
Welcome to my homepage!
If we had a statement that was equal to false then we would see this:
$name = "Bob";
if ( $name == "Adam" ) {
echo "Hello Adam!"; }
echo "Welcome to my homepage!";
The output from this would be:
Welcome to my homepage!
Here are some comparison operators
check out PHP operators