i am working on a project where i need to get the complete sentence between a html tag closest to a certain character.
for example:
in given example, if i search for Mark, then i want to print the complete sentence between the closest html tag.
<span>In paris (Mark Bartels) worked for about 10 years.</span>
is there a way to find the closest html tag to a certain character in php?