Find in String with strstr() PHP function

RegisterLogin
Find in String with strstr() PHP function
Post Description: Find in String with strstr() PHP function
Tags: Find, in, String, with, strstr(), PHP, function
This Post Was Posted On Feb 29, 2008 By web hosting #1343

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
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2012 Webune Forums - Wed Dec 19, 2012 10:39 am
Powered by: Webune Forums V3