Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
2.9k views
in Introduction to Hypertext Pre-Processor by (52.0k points)
closed by

Explain operators in PHP with example?

1 Answer

+1 vote
by (48.2k points)
selected by
 
Best answer

Operators in PHP: Operator is a symbol which is used to perform mathematical and logical operations in the programing languages. 

Different types of operator in PHP are:

1. Arithmetic operators 

2. Assignment operators 

3. Comparison operators 

4. Increment/Decrement operators 

5. Logical operators, and 

6. String operators.

1. Arithmetic operators: The arithmetic operators in PHP perform general arithmetical operations, such as addition, subtraction, multiplication and division etc.

2. Assignment Operators: Assignment operators are performed with numeric values to store a value to a variable. The default assignment operator is “ = ”. This operator sets the left side operant value of expression to right side variable.

3. Comparison Operators: Comparison operators perform an action to compare two values. These values may contain integer or string data types (Number or Strings).

4. Increment and Decrement Operators: Increment and decrement operators are used to perform the task of increasing or decreasing variable’s value. This operator is mostly used during iterations in the program logics.

5. Logical Operators: Logical Operators are used to combine conditional statements.

6. String Operators: Two operators are used to perform string related operations such as Concatenation and Concatenation assignment (Appends).

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...