PHP text string contains character
$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:
- export html table data to excel in php
- How to change add to cart button in wordpress
- create laravel project in laravel/laravel
- count length of string pphp
- avoir la date php
- create new laravel project terminal
- eloquent run seeder
- find a string in another one phph
- current date into time
- error_log wordpress
- composite unique between two columns laravel migration
- asia time zone in php
- clear array php
- create array from string with commas php
- date du jour en php
- contain in string php
- ata date format in php
- exception php
- codeigniter insert get id
- build laravel project
- ADD OR ON SWITCH CASE PHP
- buscar texto dentro de php
- cache:clear php artisan
- How can I install php7.4 on Ubuntu 18.04?