PHP Find Specific Word from String Example
Hi Dev,
In this example, you will learn php find specific word from string example. I’m going to show you about how to find specific word from string in php?. This tutorial will give you simple example of find specific word from string in php example. step by step explain how to use function to find specific word from string in php? .
In this example to php find specific word from strings in PHP. in this example, we will use to explode() function used to find specific word. so Let's see the following example with output.
Example: Find Specific Word from String
index.php
<?php
$str = "I am PHP Developer";
// Get Specific Word from string
$strArray = explode(' ',$str);
$result = $strArray[2];
echo $result;
?>
Output:
PHP
I hope it could help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example