Turn Your Vehicle Into a Smart Earning Asset

While you’re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

πŸš— You set the rental price
πŸ” Secure bookings with verified renters
πŸ“ Track your vehicle with GPS integration
πŸ’° Start earning within 48 hours

Join as a Partner Today

It’s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

Else-If Statement, Ternary or Conditional Operator and Switch Statement in PHP

Else-If Statement

Syntax

Sample Program

Output

In the above program, if the First condition is false then it will check the third condition, if it’s true then print it else check next condition and so on.

Ternary or Conditional Operator.

It works similar to the else-if statement. In this Operator, if the condition is true then it returns First-Expression else Second-expression.

Syntax

Variable = Condition ? Expression1 : Expression2

For Example:- $a = (5>1) ? “Greater” : “Less” ;

Sample program

<?php
$a = (5>1) ? “Greater” : “Less” ;
echo $a;
?>

Output

Switch Statement

It checks several constant values for an expression.

Syntax

switch(expression){
case expression1:
block of statements;
break;
case expression2:
block of statements;
break;
case expression-n:
block of statements;
break;
default:
block of statements;
}

Sample Program

Output

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.