“la cadena contiene PHP” Código de respuesta

Php verifique si la cadena contiene Word

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

la cadena PHP contiene

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

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

TomatenTim

Php si la cadena contiene

$a = 'How are you?';

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

la cadena contiene PHP

$a = 'How are you?';

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

Php si la cadena contiene

if (str_contains('How are you', 'are')) { 
    echo 'true';
}
nanaseous

Str_incluye 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
RedGuy12

Respuestas similares a “la cadena contiene PHP”

Preguntas similares a “la cadena contiene PHP”

Más respuestas relacionadas con “la cadena contiene PHP” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código