I want to make a string already defined be replaced by an array .
For example, the value of the string is $
. I want it to be replaced by dollar sign . For this I created an array with the replacement data:
$arr_symbols = 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");
What is the fastest and most efficient way to find the symbol and replace it with the corresponding value?