Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement