How To Check String In Switch Case

Share Now

Share on facebook
Share on pinterest
Share on twitter
Share on linkedin
Share on email
$ball = "8balls";
 switch( $ball ){
	case (string) "9balls":
		echo "NINE BALLS";
		break;
	case (string) 8:
		echo "8 Balls";
		break;
	case (string) "8balls":
		echo "Eight Balls";
		break;
	default:
		echo "Just Balls";
		break;	
 }
Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert