Jump to content
MakeWebGames

Recommended Posts

Posted

I was wondering...is there a way to have the same case catch a different number? For example

 

rand(1,10)

Case 1: Blah Blah

Case 2,3,4,5: Yada yada

Case 6,7,8,9,10: Pikachu

 

For some reason, I though AND would work, but it keeps looping the first case lol. TY in advance

Posted

Re: Multiple Cases

switch($_GET['action'])

{

case "buy1":

buy_1();

break;

}

function buy_1()

{

blah blah blah

}

Not sure if that's what your looking for

Posted

Re: Multiple Cases

try something along this lines...

$rare = rand(111,1111);

if ($rare = 666)

{

give rare item;

exit;

}

else {

$go = rand(1,10)

switch($go)

{

case ($go=='1'):

blah blah;

break;

case ($go=='2' || $go=='3' || $go=='4' || $go=='5'):

Yada yada;

break;

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...