Advertisement
Venciity

Pretty Text Hasher

Aug 23rd, 2014
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2. if (isset($_GET['text']) && isset($_GET['hashValue']) && isset($_GET['fontSize']) && isset($_GET['fontStyle'])) {
  3.     $text = $_GET['text'];
  4.     $hashValue = $_GET['hashValue'];
  5.     $fontSize = $_GET['fontSize'];
  6.     $fontStyle = $_GET['fontStyle'];
  7.  
  8.     for ($i = 0; $i < strlen($text); $i++) {
  9.         if ($i % 2 == 0) {
  10.             $text[$i] = chr(ord($text[$i]) + $hashValue);
  11.         }
  12.         else {
  13.             $text[$i] = chr(ord($text[$i]) - $hashValue);
  14.         }
  15.     }
  16.  
  17.     $result = '<p style="font-size:'.$fontSize . ';';
  18.     if ($fontStyle == "bold") {
  19.         $result .= 'font-weight:'.$fontStyle . ';">';
  20.     }
  21.     else {
  22.         $result .= 'font-style:'.$fontStyle . ';">';
  23.     }
  24.     $result .= $text;
  25.     $result .= '</p>';
  26.  
  27.     echo $result;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement