Suppose I have string below,
$text = "Hello World!";
By using below code to get string position. By using string position we can check/search in a given string.
if (strpos($text, 'World') !== false) { echo 'true'; }
Basically the expected ouput is "true".
Note that the use of !== false is deliberate. The strpos() function finds the position of the first occurrence of a string inside another string.
You might also like:
How to get id by using name attribute in javascript20-03-2017 html id name javascript |
How to use http-post request in node js14-03-2017 http-post module node js |
Sanitization in java sript14-03-2017 sanitization java script |
Remove last two characters from given string06-03-2017 substring javascript remove |
Change datepicker display format06-03-2017 datepicker angular js |