php удалить из строки символ
Primary tabs
возможно такое решение:
function str_to_arr($str) // string to array { $result = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); return $result; } function rem_symbs($str) // remove symbols from string - ОСНОВНАЯ ФУНКЦИЯ { $result=""; $spec = array ("$", " "); // SYMBOLS TO REMOVE $arr = str_to_arr($str); foreach ($arr as $value) { if (array_search($value,$spec)===FALSE) $result.=$value; } return $result; }
- Log in to post comments
- 2499 reads