check if substring in in string php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}$result = strpos("haystack", "needle");
if ($result != false)
{
// text found
}
Also in PHP:
- convert date time to timestamp php
- How to handle max time of execution
- best way to redirect with php
- clear cache laravel on server
- Allowed memory size of 134217728 bytes exhausted in php 7 linux
- Allowed memory size of 1610612736 composer install
- create random string and number with laravel
- add to hours to variable date php
- assoc key unique php
- Connecting that to Database using PHP.
- clear cache in laravel in windows cmd
- apache 2 lib php 7.4
- check if value in string php
- change font color if background is dark or light in php
- Dynamic title on every page laravel blade
- current date function in php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/Users/marvinp/AppData/Local/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
- create foreign key laravel migration
- drupal/core 9.0.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- compare two arrays and return the difference php
- error_reporting all
- PHP try catch all exceptions
- check contain in string php
- db seeder laravel 5