<?php $string = 'The story is inspired by the Operation Batla House that took place in 2008 '; $tag = '2.0'; $pattern = '/(\s|^)'.preg_quote($tag, '/').'(?=[^a-z^A-Z])/i'; echo preg_replace($pattern, '2.0', $string);
You have javascript disabled. You will not be able to edit any code.