i am trying to make a small search script, but i cannot get it to search for a particular keyword that may end in a space...

my input string is like...

amit qby:name hello

i want the preg_match to gimme qby:name

another input string can be

amit qby:name

i can get it to work for only one of the cases.. plz help...

if (preg_match('/qby:name/m', $subject)) {
	# Successful match
else {
	# Match attempt failed
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.