PHP
  Home arrow PHP arrow PHP Operators
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
OLM
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

PHP Operators
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 18
    2007-10-31

    Table of Contents:
  • PHP Operators
  • Assignment Operators
  • Arithmetic Operators
  • Incremental Operators
  • Better by Comparison
  • Logical Operators

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Ziff Davis Enterprise Virtual Tradeshows: Hot Topics, Cutting Edge Technology, Real-time Interaction with IT Professionals. Learn more at ziffdavisvts.com

    PHP Operators
    (Page 1 of 6 )

    What can you do without operators? Not much, if you're trying to do without them in a programming language, and PHP is no exception. On Monday, we barely had time to show you a long list of the operators in PHP. Today, we're going to show you what they do.

    In our last tutorial I left you with a giant table full of operators to study. But I know you, and you are a slacker, so instead of making you go back to that previous article like I should, I am going to spot you one and post it here for you again. That and well...it helps increase my word count. All hail laziness!

     

    Symbol

    What it Does

    Type

    +

    Used for Addition

    Arithmetic

    -

    Used for Subtraction

    Arithmetic

    *

    Used for Multiplication

    Arithmetic

    /

    Used for Dividing

    Arithmetic

    %

    Used for Modulation

    Arithmetic

    ++

    Used to increase value by one

    Arithmetic

    --

    Used to decrease value by one

    Arithmetic

    “=”

    Used to Assign a Value

    Assignment

    +=

    Used to Add and Assign a Value

    Assignment

    -=

    Used to Subtract and Assign a Value

    Assignment

    *=

    Used to Multiply and Assign a Value

    Assignment

    /=

    Used to Divide and Assign a Value

    Assignment

    .=

    String Concatenation

    Assignment

    %=

    Used to Modulate and Add a Value

    Assignment

    “==”

    Equal To

    Comparison

    !=

    Not Equal To

    Comparison

    >

    Greater Than

    Comparison

    <

    Less Than

    Comparison

    >=

    Greater Than or Equal To

    Comparison

    <=

    Less Than or Equal To

    Comparison

    &&

    This is the Logical (AND) Operator that Returns a True Value if All Expressions Being Checked Are True

    Logical

    ||

    This is the Logical (OR) Operator that Returns a True Value if Any of the Expressions Being Checked Are True

    Logical

    !

    This is the Logical (NOT) Operator that Returns a True Value if the Expression Being Checked Is Not True

    Logical

    So there you go. No, you aren't having deja vu. That's just a glitch in the Matrix. Like the third part in that movie series. I mean, way to ruin a trilogy. Let's create a third movie and then have the main characters, who have been the focus of the previous two movies, only be in the final installment for like 20 minutes. Don't get me started.

    Okay where was I?

    More PHP Articles
    More By James Payne


       · Hey thanks for taking the time to read my article on PHP Operators- I hope it was...
       · . . . but, if I remember Correctly, it's Sisko, not Cisco. And Archer is way...
       · I don't recall if it is in PHP4, but the === operator can be quite valuable.
       · Don't you need some backslashes and an ending quote?echo "<h1...
     

       

    PHP ARTICLES

    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway