Blade 中的等效 strpos() 函数

Equivalent strpos() function in the Blade

请告诉我以下命令在 Blade 中的等价物是什么

if (strpos($a,'are') !== false) {
    echo 'true';
}

如果您要查找字符串中是否存在子字符串,那么 str_contains() 就是您要查找的内容 Laravel Helper Methods


如果你想使用 with blade 那么。

@if(strpos($a,'are') !== false) 
    // do stuff 
@endif