Advertisement
khlau

Input Transformation

Jul 3rd, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.19 KB | None | 0 0
  1. <?php
  2.  
  3.     $input = '12304';
  4.    
  5.     for($i=0; $i <= strlen($input); $i++){
  6.         $num = (int)$input[$i];
  7.        
  8.         if($num % 2 == 0)
  9.             echo 'e';
  10.         else
  11.             echo 'd';
  12.        
  13.         if($num == 0)
  14.             echo 'Z';
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement