If your new to PHP like you are. I'd suggest using the curly brackets.
I'll also give you a little trick with if() if you don't already know it.
The code below.
PHP Code:
$test = "Dog";
if($test == "Dog"){
$testNext = "Cat";
} else {
$testNext = "Dog";
}
Is equivalent to(check below for explanation:
Code:
$test = "Dog";
$testNext = ($test=="Dog") ? "Cat" : "Dog";
Red : if()
Blue : $test == "Dog"
Navy : First bracket( ' { ' )
Gray : $textNext = "Cat"
Light Blue : Else bracket( ' } ' )
Yellow : $textNext = "Dog"
Bookmarks