Skip to content

Commit cc4ec1c

Browse files
authored
Merge pull request #10 from jNullj/parenthesized-text
Added parenthesized style, fixed #6 , closes #6
2 parents f8df759 + 6b6d3be commit cc4ec1c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

decorator.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ public function leet($text){
3636
$to = ['4','3','6','1','0','5','7','4','3','6','1','0','5','7'];
3737
return str_replace($from, $to, $text);
3838
}
39+
40+
public function parenthesized($text){
41+
$unicode_parent = range(hexdec('249C'), hexdec('24B5'));
42+
foreach($unicode_parent as $key => $val){
43+
$unicode_parent[$key] = dechex($val);
44+
}
45+
$map = array();
46+
foreach($unicode_parent as $val)
47+
{
48+
$myval = "\u{$val}";
49+
$myval = json_decode('"'.$myval.'"');
50+
array_push($map, $myval);
51+
}
52+
return str_replace($this->lower, $map, $text);
53+
}
3954
}
4055

4156
?>

index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
Circled text: </th><th><input type="text" name="cool1" value="<?=$dec->cycle($_POST["input"]); ?>" readonly /></th>
3030
</tr><tr><th>
3131
Leet text: </th><th><input type="text" name="cool1" value="<?=$dec->leet($_POST["input"]); ?>" readonly /></th>
32+
</tr><tr><th>
33+
Parenthesized text: </th><th><input type="text" name="cool1" value="<?=$dec->parenthesized($_POST["input"]); ?>" readonly /></th>
3234
</tr>
3335
<?php
3436
}

0 commit comments

Comments
 (0)