This file contains 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
" ------------ | |
" Vim settings | |
" ------------ | |
" Always use long form options, so it's more obvious what they do | |
set nocompatible " Use Vim defaults (better than Vi defaults) | |
filetype plugin indent on | |
set encoding=utf8 " Set encoding | |
scriptencoding utf-8 |
This file contains 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
//from post at http://davidnash.com.au/pretty-print-fractions-html-characters-using-php/ | |
//supply a string, eg 1/2, return eg ½ | |
function str_to_fraction( $str ) { | |
$f = explode('/', $str); | |
if( count($f) != 2 ) { | |
return $str; //if there's multiply / chars, this isn't a fraction | |
} | |
else { |