dreamwest Posted May 21, 2009 Share Posted May 21, 2009 Im trying to see if a file has a certain name part $file = "video-of-something.mpg"; if ($file has "video"){ echo "file has video in the name"; } I just need to check if the $file has "video" in the string Quote Link to comment https://forums.phpfreaks.com/topic/159184-str-contains/ Share on other sites More sharing options...
MasterACE14 Posted May 21, 2009 Share Posted May 21, 2009 $file = "video-of-something.mpg"; if(strpos($file,"video")) { echo "file has video in the name"; } Quote Link to comment https://forums.phpfreaks.com/topic/159184-str-contains/#findComment-839512 Share on other sites More sharing options...
dreamwest Posted May 22, 2009 Author Share Posted May 22, 2009 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/159184-str-contains/#findComment-839516 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.