Codice PHP:
<?php
switch($valore){
   case 
0:
      
$testo "000000";
      break;
   case 
1:
      
$testo "111111";
      break;
   case 
2:
      
$testo "222222";
      break;
   case 
3:
      
$testo "333333";
      break;
}

$testo addslashes($testo);
?>
<script type="text/javascript">
<!--
   alert('<?php print $testo?>');
//-->
</script>