find character in string php

find character in string php

In this post we will give you information about find character in string php. Hear we will give you detail about find character in string phpAnd how to use it also give you demo for it if it is necessary.

You can use the PHP strpos() function to check whether a string contains a specific word or not.


The strpos() the function returns the position of the first occurrence of a substring in a string. If the substring is not found it returns false. Also note that string positions start at 0, and not 1.


Let’s check out an example to understand how this function basically works:



<?php
$word = "find";
$mystring = "how to find char from string in php";
 
// Test if string contains the word 
if(strpos($mystring, $word) !== false){
    echo "Yes found that";
} else{
    echo "Not Found!";
}


i hop it can be help lot.

Hope this and post will helped you for implement find character in string php. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

62  +    =  70

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US