Jump to content

How does a 'switch' statement work?


phrozenflame

Recommended Posts

I backtracked and found somethign I didn't understand, I have tried fighting with these for awhile, the switch case statements, I am not sure how or when to supplement these, I wrote my own script, basic script to test, and mastered if statements(atleast the basics).
if
<?php
$grade = 70;
$mark = 97;
$david = 53;
$jim = 63;
$walton = 96;
$jessy = 63;
$dave = 93;
$parker = 63;
if ($mark
?>
well whatever you get the picture I can't retype all that right now, but I created it to where if you compare someones grade, with teh grade value, for instance, if there grade is above 70 or equal to, it says you passed, sort of, or if it didn't they failed.  So I set all that up, and when I tried to run it to a switch case statement, THere's no way possible switch statements, are not meant to be used like that, so how are they used
Link to comment
https://forums.phpfreaks.com/topic/32150-how-does-a-switch-statement-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.