check if string contains specific string
$a = 'Hello world?';
if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
echo 'true';
}var str = "We got a poop cleanup on isle 4.";
if(str.indexOf("poop") !== -1){
alert("Not again");
}
Also in PHP:
- array_push
- Which of the following Laravel frameworks can be used to manage the dependencies of a PHP software?
- extract contact page url php
- enable display error in php
- compare two arrays and return the difference php
- disable errors in php
- How to add T in date in php
- codeigniter device
- date_format timeformat php
- disable login and register in laravel
- $this in catch block php
- date_default_timezone_set for india in php laravel
- console log a variable in php
- convert date to timetamp in php
- String includes() php
- delete register option laravel 7
- It is possible to perform an HTTPS redirect using PHP code as well as writing PHP code to prevent the browser from caching your we
- clear app cache laravel
- check if letter in string php
- create date from string php
- How to get location information from ip address in php
- date('Y ', $date);
- convert date object to string php
- arr::plunk laravel