匹配项目搜索,如谷歌 - PHP代码

I wanna write a function like this function (str, find){} such that when I have a str like

Hello every body, HeLlo and hElLo everyone blah

and term find like "hello", i get the result

<span class="match">Hello</span> every body, <span class="match">HeLlo</span> and <span class="match">hElLo</span> everyone blah
echo preg_replace('~Hello~i', '<span blabla>\0</span>', 'Hello every body, HeLlo and hElLo everyone blah');

gives

<span blabla>Hello</span> every body, <span blabla>HeLlo</span> and <span blabla>hElLo</span> everyone blah