Guest User

Untitled

a guest
Feb 27th, 2020
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function replace(string $string): string
  2. {
  3.     $wordsArray = [
  4.         'Да' => 'Смайл1',
  5.         'Нет' => 'Смайл2',
  6.         'Возможно' => 'Смайл3',
  7.         'Куда' => 'Смайл4',
  8.         'а' => '!'
  9.     ];
  10.  
  11.     return str_replace(array_keys($wordsArray), array_values($wordsArray), $string);
RAW Paste Data