<?php function my_replace(string $fullText, string $searchText){ $searches = explode(' ',$searchText); $replace = array(); foreach ($searches as $i => $search){ $position = strlen($search)+stripos($fullText, $search); $fullText = substr_replace($fullText, '<- ', $position, 0); } return $fullText; } echo my_replace('A week ago, Elvis left the Building', 'elvis left bonk');
You have javascript disabled. You will not be able to edit any code.