check if line contains 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:
- Which are valid PHP error handling keywords? try throw catch finally
- console/log php
- console.log php variables
- check substring php
- clear browser cache in laravel
- Allowed memory size of 134217728 bytes exhausted setup di compile
- PHP Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt()
- debug php with print
- errors register
- current datetime php function
- error enable in php
- add seeder laravel
- check array have a key php
- date time format php simple
- check if an array contains a key php
- check array key php
- check is home page
- failed to open stream: no such file or directory php
- disable login route auth laraevl
- failed to open stream permission denied laravel
- app clear cache in laravel
- check if key is in array php
- db seed
- exec output php