Skip to content

Instantly share code, notes, and snippets.

@johncarter-
Last active November 6, 2020 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johncarter-/4e09bfffe682cea8a965fc1cf45809f7 to your computer and use it in GitHub Desktop.
Save johncarter-/4e09bfffe682cea8a965fc1cf45809f7 to your computer and use it in GitHub Desktop.
HTML Fraction Entities to string
<?php
$fractionStrings = [
'½' => 'half',
'⅓' => 'third',
'⅔' => 'two-thirds',
'¼' => 'quarter',
'¾' => 'three-quarters',
'⅕' => 'fifth',
'⅖' => 'two-fifths',
'⅗' => 'three-fifths',
'⅘' => 'four-fifths',
'⅙' => 'sixth',
'⅚' => 'five-sixths',
'⅐' => 'seventh',
'⅛' => 'eighth',
'⅜' => 'three-eighths',
'⅝' => 'five-eighths',
'⅞' => 'seven-eighths',
'⅑' => 'ninth',
'⅒' => 'tenth',
];
// e.g. echo $fractionStrings['⅝']; // 'five-eighths'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment