Created
May 9, 2019 19:37
-
-
Save jongacnik/5ff9cdc98666d2739eb2f54de334108a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function replace_fractions ($input) { | |
return str_replace( | |
['1/4', '1/2', '3/4', '1/3', '2/3', '1/8', '3/8', '5/8', '7/8', '1/5', '2/5', '3/5', '4/5', '1/6', '5/6', '1/7', '1/9', '1/10'], | |
['¼', '½', '¾', '⅓', '⅔', '⅛', '⅜', '⅝', '⅞', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅐', '⅑', '⅒'], | |
$input | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment