This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Control Flow: Switch Forum

View Course » View Exercise

2099 points
52ffd3b07c82ca0e0e00094d_428382562
Submitted by
Ethan Redmond
over 4 years ago

Help!

I'm stuck


6 votes

permalink

hi Tatjana I already completed the course
but anyway here's the full code

<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body>
    <?php
    $fruit = "Apple";

switch ($fruit) {
    case "Apple":
        echo  "Yummy.";
        break;
default:
        echo "welcome";

}

    ?>
    </body>
</html>

Hope that was fast enough :-)

2099 points
52ffd3b07c82ca0e0e00094d_428382562
Submitted by
Ethan Redmond
over 4 years ago

3 Comments

527677fcabf82128d50042ae_584313652 Tatjana Seketa over 4 years ago

Thanks!

51bb751a8c1ccc3335001be9_985775030 Amanda over 4 years ago

Thanks, I found the directions and hint to be really unhelpful in this lesson.

527677fcabf82128d50042ae_584313652 Tatjana Seketa over 4 years ago

^


1 vote

permalink

Here is my PHP:

<?php
    $fruit = "Apple";

    switch ($fruit) {        
        case 'Banana':
            echo "Yummy";

        default 'Apple':
            echo "Yummy.";
            break;
    }

    ?>

What is wrong? Please help me ASAP! qwertyuiopasdfghjklzxcvbnm!!!

3347 points
527677fcabf82128d50042ae_584313652
Submitted by
Tatjana Seketa
over 4 years ago

2 Comments

52ffd3b07c82ca0e0e00094d_428382562 Ethan Redmond over 4 years ago

Just submitted the code

53f3764e282ae3da53000455_587160470 Julijana Seketa over 4 years ago

now i know what i did wrong. thanks tatjana.


0 votes

permalink

Thank you for cooperation!

edit: Sorry, my bad. Didn't notice this was posted on a specific exercise.

504 points
2b153953ef015ea1708bd5f306bd2bb6?s=140&d=retro
Submitted by
Roni
over 4 years ago

1 Comment

527677fcabf82128d50042ae_584313652 Tatjana Seketa over 4 years ago

It's OK, all is forgiven. :)


0 votes

permalink

My response to this exercise:

switch ($fruit) {
case 'Apple':
echo "Yummy.";
break;
default : "I want a banana!"; }
?>

467 points
514e85a62acdd711100005f9_630708449
Submitted by
Tamara Evans
over 4 years ago


0 votes

permalink

This works on Chromium browser.
<!DOCTYPE html>





<?php
$fruit = "Apple";

switch ($fruit) {
    case 'Apple':
        echo "Yummy.";
        break;
        default:
    }
?>
</body>

1228 points
52f07fbc548c358e90000e1a_385034243
Submitted by
carlosmante
about 4 years ago


0 votes

permalink

<!DOCTYPE html>





<?php
$fruit = "Apple";

switch ($fruit) {
    case 'Apple':
        echo "Yummy.";
        break;
    default:
        echo "Tasty";
}

?>
</body>

1246 points
55c7afa2937676dc6a000065_90077525
Submitted by
Alejandro
about 2 years ago