fork download
  1. <?php
  2.  
  3. $simbolos = array("’" => "apostrophe", "" => "apostrophe", "(" => "parentheses", ")" => "parentheses", "[" => "square brackets", "]" => "square brackets", "{" => "curly brackets", "}" => "curly brackets", ":" => "colon", "ː" => "ipa triangular colon", "," => "comma", "،" => "arabic comma", "–" => "en dash", "—" => "em dash", "‒" => "figure dash", "…" => "ellipsis", ". . ." => "ellipsis", "⋯" => "mid-line ellipsis", "!" => "exclamation mark", "¡" => "inverted exclamation mark", "՜" => "armenian exclamation mark", "ǃ" => "alveolar click sign", "." => "period", "-" => "hyphen-minus", "‑" => "non-breaking hyphen", "?" => "question mark", "“" => "quotation marks", "”" => "quotation marks", "’" => "quotation marks", "‘" => "quotation marks", "”" => "citation marks", "”" => "citation marks", "«" => "guillemets", "»" => "guillemets", "「" => "cjk brackets", "」" => "cjk brackets", ";" => "semicolon", "/" => "slash", "⁄" => "fraction slash", "∕" => "division slash", "•" => "interpunct", "&" => "ampersand", "*" => "asterisk", "\\" => "backslash", "•" => "bullet", "◦" => "white bullet", "‣" => "triangular bullet", "^" => "circumflex aceent", "‸" => "caret", "⁁" => "caret insertion point", "^" => "fullwidth circumflex accent", "†" => "dagger", "‡" => "double dagger", "°" => "degree", "″" => "ditto mark", "¿" => "inverted question mark", '#' => "number sign", "№" => "numero sign", "÷" => "obelus", "º" => "ordinal indicator", "ª" => "ordinal indicator", "%" => "percent", "‰" => "per mil", "+" => "plus", "−" => "minus", "‱" => "per ten thousand sign", "¶" => "pilcrow", "′" => "prime", "″" => "double prime", "‴" => "triple prime", "§" => "section sign", "~" => "tilde", "˜" => "tilde", "∼" => "tilde operator", "_" => "underscore", "|" => "vertical bar", "¦" => "broken bar", "‖" => "magnitude", "∣" => "divides", "©" => "copyright", "℗" => "sound-recording copyright", "®" => "registered trademark", "⁂" => "asterism", "❧" => "fleuron", "☞" => "index", "‽" => "interrobang", "◊" => "lozenge", "※" => "reference mark", "⁀" => "tie", "$" => "dollar sign");
  4. $simbolo = "$";
  5.  
  6. foreach($simbolos as $chave => $valor) {
  7. if (strpos($chave, $simbolo) === 0) {
  8. $simbolo = $valor;
  9. } else {
  10. // Fazer algo aqui caso não encontre
  11. }
  12. }
  13.  
  14. echo $simbolo . "\n";
Success #stdin #stdout 0.01s 24400KB
stdin
Standard input is empty
stdout
dollar sign