Str_includes php

코드 예제

49
0

str_includes php

$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
    echo "My string contains Bob";
}
3
0

는 방법을 확인하는 문자열이 포함되 substring php

$a = 'How are you?';

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

php 는 문자열에서 여러 문자열 찾기

if(preg_match('(bad|naughty)', $data) === 1) { } 
2
0

는지 확인하려면 어떻게 해야 하는 문자열이 포함되는 특정 word?

$a = 'Hello world?';

if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
    echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
    echo 'true';
}
1
0

str_includes php

<?php
$string = 'The lazy fox jumped over the fence';

if (str_contains($string, '')) {
    echo "Checking the existence of an empty string will always return true";
}

if (str_contains($string, 'lazy')) {
    echo "The string 'lazy' was found in the string\n";
}

if (str_contains($string, 'Lazy')) {
    echo 'The string "Lazy" was found in the string';
} else {
    echo '"Lazy" was not found because the case does not match';
}

# Checking the existence of the empty string will always return true
# The string 'lazy' was found in the string
# "Lazy" was not found because the case does not match

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................