How to check if a string contains a character or word in php?
Answer / Niraj Kumar Srivastava
You can use the `strpos()` function in PHP. Here's an example of checking if a string contains a specific word:
```php
$haystack = 'Hello, World!';
$needle = 'World';
if (strpos($haystack, $needle) !== false) {
echo '$haystack contains $needle';
}
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Is there an easy way to delete an element from a php array?
Write a program to get lcm of two numbers using php?
What is difference between web service and api?
What does csrf token mean?
Draw the architecture of Zend engine?
Does php support polymorphism?
What is meant by pdo in php?
Is php dead 2019?
Why would we use === instead of ==?
How do you pass a variable by value in php?
Is laravel easy to learn?
How to call php function in jquery?