PDA

View Full Version : PHP function for finding out if string is part of another string ?


cinq
02-23-2005, 01:13 PM
I got a string, say a="test1 test2 test3"

I got another string, say b="test1"

I want to check if b occurs in a, any ideas on a PHP function can I use ?

Ah nvm....ereg or preg_match ... :D

Dean C
02-23-2005, 01:43 PM
Nope, use strpos :) Far quicker