About 3,210,000 results
Open links in new tab
  1. PHP - Comparison Operators Examples - Online Tutorials Library

    PHP Comparison and Logical Operators. In PHP, comparison operators compare two values and logical operators combine multiple conditions. The PHP programbelow shows how to use comparison (>, <) and logical operators (&&, ||) to decide loan eligibility and special discounts.

  2. PHP Operators - W3Schools

    PHP Operators. Operators are used to perform operations on variables and values. PHP divides the operators in the following groups: Arithmetic operators; Assignment operators; Comparison operators; Increment/Decrement operators; Logical operators; String operators; Array operators; Conditional assignment operators

  3. PHP: Logic - Manual

    <?php $a = $fruit || 'apple'; //if $fruit evaluates to FALSE, then $a will be set to TRUE (because (bool)'apple' == TRUE)?> instead, you have to use the '?:' operator: <?php $a = ($fruit ? $fruit : 'apple'); //if $fruit evaluates to FALSE, then $a will be set to 'apple'?> But $fruit will be evaluated twice, which is not desirable.

  4. PHP Operators - GeeksforGeeks

    Apr 5, 2025 · In PHP, operators are special symbols used to perform operations on variables and values. Operators help you perform a variety of tasks, such as mathematical calculations, string manipulations, logical comparisons, and more. Understanding operators is essential for writing effective and efficient PHP code.

  5. Comparison and Logical Operators in PHP

    Two main types of operators are comparison and logical operators. These conditions usually come together with conditional statements like IF. They are discussed below with examples. This type of operator allows you to compare two or more values in PHP. You can compare the values and get results in true or false.

  6. PHP Script to Demonstrate Arithmetic Operators, Comparison

    In this script, we perform various arithmetic operations, such as addition, subtraction, multiplication, division, and modulus. We also use comparison operators, such as <, >, <=, >=, ==, and !=, to compare values and produce boolean results.

  7. Operators in PHP: Arithmetic, Comparison, and Logical

    Aug 15, 2023 · Among these operators, three of the most used types are arithmetic, comparison, and logical operators. This article will dive into these categories and provide examples of their usage in PHP.

  8. PHP Logical Operators - Coder Scratchpad

    Jan 1, 2024 · Logical operators in PHP allow you to combine and manipulate conditions to control the flow of your code. These operators enable you to perform logical comparisons and make decisions based on the results.

  9. 9 PHP Comparison Operators To Make Logical Comparisons

    Jun 4, 2023 · In PHP, comparison operators allow developers to compare values and evaluate logical conditions within their code. These operators enable the comparison of variables, constants, and expressions to determine their equality, inequality, or relative order.

  10. PHP Comparison Operators: Complete Guide with Examples

    In this guide, we will explore different comparison operators in PHP and see how they work with practical examples. PHP provides several comparison operators: 1. Equal (==) The == operator checks if two values are equal, ignoring their data types. $b = "10"; if ($a == $b) { echo "Equal"; echo "Not Equal"; // Output: Equal ?> 2. Identical (===)

  11. Some results have been removed
Refresh