<?php $string = 'An aim is a goal or objective Hotel in Canada to achieve in life. In order to succeed in life, one must have Hotel in, Canada a goal. My aim in life is to be a teacher. Teaching is a noble and responsible profession. I have come City Hotels to know that the ever-increasing misery and distress, are City, Hotels due to the ignorance and illiteracy City. Hotels of the people of our country. So I have decided to spread education among the masses Hotel. in Canada as much as possible within my humble power. As a teacher, I shall try my best to impart man-making education.'; $keywords = ['City Hotels', 'Hotel in Canada']; foreach ($keywords as $keyword) { $regex = preg_replace('/ +/', '[.,\s]+', preg_quote($keyword, '/')); $string = preg_replace("/\b$regex\b/iu", '**$0**', $string); } var_export($string);
You have javascript disabled. You will not be able to edit any code.