Posted By

Desoxena on 12/03/10


Tagged

binary


Versions (?)

String to Binary program!


 / Published in: PHP
 

This program will turn any string you declare in $string0, and put it into binary. kinda useless, but it's fun to do this and see if you friends can see what you were saying XD

  1. <?php
  2. $string0 = "shalom my friend!";
  3. $vowels = array("a", "e", "i", "o", "u");
  4. $consonants = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z");
  5. $string = str_replace($vowels, "0", "$string0");
  6. $stringfin = str_replace($consonants, "1", "$string");
  7. echo "$stringfin";
  8. ?>

Report this snippet  

You need to login to post a comment.