check if a string contains a substring php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}if (strpos($string, 'substring') !== false) {
// do stuff
}$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);if (strpos($a, 'are') !== false) {
echo 'true';
}str_contains('STRING', 'SUB_STRING');$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
Also in PHP:
- Artisan call Cache:clear force
- create a blank page wordpress
- $date- format php
- codeigniter 3 smtp email send
- artisan db:seed
- convert any uppercase to capitalize in php
- call seeder in laravel
- $_SERVER['HTTP_HOST'] site:'pantheon.io'
- array sort array reverse php
- C:\MyScans in php server run file
- Throw new error php
- easiest way to install laravel
- centos excecutable php
- console.log equivalent in php
- convert xml file to array php
- dom javascript frontend
- all files in a folder to array php
- check all file in server php
- PHP File Open/Read/Close
- _______ is used to execute laravel project
- "\u00e9" php
- check array key exists php js
- eloquent using last()
- echo in json format php