check if string contains letter php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}$a = 'Hello world?';
if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
echo 'true';
}$result = strpos("haystack", "needle");
if ($result != false)
{
// text found
}$haystack = 'This is my haystack that we shall check'
$has_A = strpos($haystack, 'A') !== false;
$has_a = strpos($haystack, 'a') !== false;
Also in PHP:
- find location from an ip address PHP
- console() php
- check if home page wordpress
- check if string contains a word php
- display php error on basic
- decode base 64 php
- check file selected in php
- composer laravel install
- check if string container string phph
- check string have % in php
- array size php
- cache DB table laravel
- find string into string
- create user teable ceder
- date time format 12 hour am pm php
- convert object to array php
- find characters in word php
- execute query and use die in php
- captial functuon php
- clear in laravel
- date format functino php
- check string contain symbol in php
- count characters in string php
- don't show warning php