check if string has a certain string php
$a = 'Hello world?';
if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
echo 'true';
}$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
Also in PHP:
- count charcter in php
- Installer for Laravel Application
- Allowed memory size of 536870912 bytes exhausted (tried to allocate 102400 bytes) in Unknown on line 0 laravel
- array_reverse php
- phptry catch
- date format in php for AM PM
- date formate in php
- convert small to capital in php
- array_search in php
- * in array key php
- Allowed memory size of 134217728 bytes exhausted laravel
- Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
- How do I convert timestamp to epoch time in php
- base64 to pdf generation in php
- check multiple permission laravel spatie
- adding days to a date in php
- add customer attributes via upgrad data in magento 2
- create a project laravel
- character split php
- Generate Laravel Migrations from an existing database
- array key exists php after submit
- find length of string in php
- exclude if symfony jms
- date php string