<?php $sentences = [ 'India is great country.', 'Indiana is great state.', 'I have worked in India.', 'India-based research.' ]; $search = "India"; foreach ($sentences as $sentence) { var_dump(preg_match("/\b$search\b/i", $sentence)); }
You have javascript disabled. You will not be able to edit any code.