PHP
  Home arrow PHP arrow Page 2 - PHP Statements and Beginning Loops
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 
 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 Statements and Beginning Loops
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 5
    2007-11-05

    Table of Contents:
  • PHP Statements and Beginning Loops
  • If
  • Else
  • Elseif
  • Here We Go Loop de Loop
  • For Loop

  • 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

    Dell PowerEdge Servers

    PHP Statements and Beginning Loops - If
    (Page 2 of 6 )

    People are always asking what if. What if I weren't the world's fattest man? What if I poured vodka into that Kool-Aid guy's body -- would he get drunk? I mean technically the dude is already wired. Why else would he just crash through people's wall and yell his name?

    As I said before, we already previewed the IF statement in our previous article. However, I will show it to you one more time here, just as a refresher. The basic idea of an If statement is: If this, do that.


    <html>

    <body>


    <?php


    $your_name = "Angelina Jolie";


    if ( $your_name == "Angelina Jolie") {

    echo 'Will you marry me?';

    }


    ?>


    </body>

    </html>

    In the above code, we store the name "Angelina Jolie" in a variable. We then say that if the value in $your_name is in fact "Angelina Jolie" print the line:

      Will you Marry me?

    If the value of $your_name had been any other value, nothing would have happened.

    But what good is that program if we don't get an answer? For that, let's use the If...Else statement.

    More PHP Articles
    More By James Payne


       · Hey thanks for stopping by. In this article I discuss conditional statements like...
       · On page 3:There's the following...
       · I enjoy your writing style and the subject matter but there are a few...
     

       

    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 2 hosted by Hostway