Jump to content

while(){ switch(){} } problem!


samoi

Recommended Posts

Hello guys!

 

I just wanted to do something fun like a special code decoding !!

 

so I coded the following:

 

<?
error_reporting(E_ALL & E_NOTICE);
$str = "samoi";
$char = " ";
$i = 0;
while($i < strlen($str)){

$subtype = substr($str, $i, 1);

switch ($subtype)
{

case "s":
	$char. = "S";
	break;



case "m":
	$char. = "U";
	break;

case "a":
	$char. = "L";
	break;

case "o";
	$char. = "I";
	break;

case "i";
	$char. = "M";
	break;

default:
	$char. = $subtype;


}



$i++;
}

echo $char;

?>

 

 

returns a blank page !!!

 

please help!

Link to comment
https://forums.phpfreaks.com/topic/181807-while-switch-problem/
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.