• Feed
  • About The Blog

    The Blogosaurus is a company technology blog from Louisville Web Development firm MIB Solutions. The issues on or blog range from our personal use of Wordpress, Joomla, PHP and Database programming, AJAX, Flash, and other web development languages and tools we use on our client's projects.

    The Blogosaurus was born in 2008, and continues to be a resources for Internet professionals and Google searches alike.

  • Categories

  • Archives

  • Recent Posts

  • Our Analytics


    9,383
    Unique
    Visitors
    Powered By Google Analytics
  • Look Around

  • Recent Posts

  • Categories

  • « PHP Still Top Programming Language | Home | PHP Switch Statement »

    Introducing ElseIf to your PHP

    July 15, 2009

    I’ve always been very indecisive when it comes to just about everything, so the option for an ‘elseif” in PHP runs right up my alley. Following our previous discussion on PHP IF Statements, the elseif introduces more options for your script to run with.

    if ($a < $b) {

    echo “$a is smaller than $b”;

    }

    elseif ($a == $b) {

    echo “$a is equal to $b”;

    }

    else {

    echo “Zach is still awesome”;

    }

    Please note there may be an unlimited amount of ElseIf statements in your code. With PHP you may write elseif or else if, and those working with C Language will see how this is similar. PHP will run both equally, even though the syntax is somewhat different. I personally would just use the one word, but that’s me.

    Comments