案例1:
$tofind= "The Flash Tv Show";
$tags= array("flash-new","netflix","article","season");
foreach ($tags as $key => $tag)
{
if (preg_match("/$tofind/",$tag))
{
echo 'true';
}
else
{
echo'false';
}
}`
我想要的回报:" flash-new"标记来自$ tags数组
案例2:
$tofind = "PHP Development Artice";
$array = array("java","develop","post");
返回我想要:开发
案例3:
$tofind = "StackOverflow Questions";
$array = array("stack Overflow","sql","php");
返回我想:堆栈溢出