PHP文字列str_contains
strpos

str_contains文字列

str_starts_with

文字列が含まれているか確認します。(PHP 8+)

構文

str_contains(string $haystack, string $needle): bool

使用例

下記の値を入力するとサンプルに即時反映されます。

if
str_contains
echo
if (str_contains("Hello World", "World")) {
    echo "포함됨";
}