Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // -------------------------------------------------
- // Kohana 3.0'dan alıntı
- // HTML::obfuscate
- // -------------------------------------------------
- function obfuscate($string)
- {
- $safe = '';
- foreach (str_split($string) as $letter)
- {
- switch (rand(1, 3))
- {
- // HTML entity code
- case 1:
- $safe .= '&#'.ord($letter).';';
- break;
- // Hex character code
- case 2:
- $safe .= '&#x'.dechex(ord($letter)).';';
- break;
- // Raw (no) encoding
- case 3:
- $safe .= $letter;
- }
- }
- return $safe;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement