Guest User

Untitled

a guest
Apr 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <html>
  2. <?php
  3. function toAscii($letter){
  4. return ord($letter);
  5. }
  6.  
  7. function toBinaryAscii($letter){
  8. return decbin(ord($letter));
  9. }
  10.  
  11. function eachLetterInWord($word){
  12. $strlength=strlen($word);
  13. for($i=0; $i <$strlength; $i++){
  14. echo toBinaryAscii($word[$i])." is the binary for ". toAscii($word[$i]). " which is the ascii for ".$word[$i]."<br>";
  15. }
  16. }
  17.  
  18.  
  19. eachLetterInWord("Basu");
  20. ?>
  21. </html>
Add Comment
Please, Sign In to add comment