If Today is Sat, code will print as “This is Saturday.Have a nice weekend Bro!!” like that and If Today is Sun, the code will print as “Have a Happy Weekend! Now We are in Sunday!! Įcho "Second Number(number_2) = $number_2" Įcho "1st Number : $number_1 is not prime number" Įcho "1st Number : $number_1 is a prime number" Įcho "2nd Number : $number_2 is not prime number" Įcho "2nd Number : $number_2 is a prime number" By using the conditions of the “s” variable’s value the code will provide the output. Date(“d”) will have the value of Today/present day. This is the basic PHP code which is listed below to know whether Today/Present-day is Saturday/Sunday. This is the basic PHP program to know which number is greater which are stored in the number_one, number_two variables using one if and else conditions by comparing the two variable’s values.Įcho "$number_one is greater than $number_two" Įcho "$number_two is greater than $number_one" Given below are the examples of if else Statement in PHP: Example #1 else: Else function works when the if, Extra if conditions fail in the program/code in PHP/any other Programming Language mostly.if: If function works when the conditions inside of the function are true else compiler will go to else condition if extra if the condition is not there at first.(Multiple iF statements can be ignored to if we don’t want)Ĭode Here will run only if the IF condition becomes FALSE Programming code statements to run only if the IF condition is TRUEĪnother code to be executed with an extra IF condition.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |