Results 1 to 10 of 42

Thread: Day 4 - Decision Making - Become PHP Expert in 30 days

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2014
    Posts
    21

    Default

    http://php.flashwebhost.com/austin/day4.php

    Code:
    <?php$animal = 'tiger';
    $color = 'green';
    
    
    if($animal == 'frog'){
    	if($color=='green'){
    		echo 'You are green frog';
    	}
    	else
    		echo 'You are an invisible frog';
    }
    
    
    else if($animal=='dragon'){
    
    
    	if($color == 'green')
    		echo 'You are a green dragon and stefin got your eggs :D';
    
    
    	else if($color=='red')
    		echo ' You are a red dragon and stefin is coming to steal ur eggs too :D';
    }
    
    
    else{
    	echo 'i know you are a tiger and you are green.';
    }
    Stefin ... run!!!!

  2. #2
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by Austinwhite View Post
    http://php.flashwebhost.com/austin/day4.php

    Code:
    <?php$animal = 'tiger';
    $color = 'green';
    
    
    if($animal == 'frog'){
    	if($color=='green'){
    		echo 'You are green frog';
    	}
    	else
    		echo 'You are an invisible frog';
    }
    
    
    else if($animal=='dragon'){
    
    
    	if($color == 'green')
    		echo 'You are a green dragon and stefin got your eggs :D';
    
    
    	else if($color=='red')
    		echo ' You are a red dragon and stefin is coming to steal ur eggs too :D';
    }
    
    
    else{
    	echo 'i know you are a tiger and you are green.';
    }
    Stefin ... run!!!!

    Good code, use { } even if it is only one line code, lets have some coding style everyone follow, so no one (me) get confused
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •