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:
Simple Array Sum | Javascript | hackerrank.com07-05-2020 hackerrank.com javascript arrays array sum |
File Upload Using Angular Js and Node Js28-05-2018 AngularJs Node js file upload multer module |
Sanitization in java sript14-03-2017 sanitization java script |
How to make an http request in node js14-03-2017 http module node js |
How to get drop down value when drop down change using javascript27-02-2017 onchange events dropdown javascript functions |