If I'm using this code:
$input_words = array("yourself", "myself", "are you", "you are","you will", "you","i am","am i", "I", "were", "was", "my", "mine");
$bot_view = array("myself","yourself", "am I", "I am", "I will","me","you are","are you", "you", "was", "were", "your", "your's");
$converted_first_sentence = str_replace($input_words, $bot_view, $first_sentence);
How can I prevent a part of a string from being replaced more than one such as:
"are you" into "am I" into "are you". I can't think of a solution.