- Forums
- PHP
- Find In String With Strstr() PHP Function
This Page Contains information about Find In String With Strstr() PHP Function By wallpaperama in category PHP with 9 Replies. [1133], Last Updated: Sat May 18, 2024
wallpaperama
Wed Mar 19, 2008
9 Comments
6313 Visits
strstr()
if you want to find a value in a string, you can use the strstr() function in php
lets say i want to find out if the following string contains the word wallpaperama:
<?
$find = 'wallpaperama';
$string = 'i like wallpaperama because it helps me with my wallpaper website';
if(strstr($string,$find)){
echo 'yes, i found it';
}else{
echo 'no, its not found';
}
?>
OUTPUT:
yes, i found it
hope this helps
Thanx;
God bless you.