Forum Moderators: coopster

Message Too Old, No Replies

What's the right way to use ereg with spaces?

         

fintan

11:47 am on Nov 11, 2005 (gmt 0)

10+ Year Member



Hi I need to search for a users name in a column in a database. Something like this


if(ereg('John Doe', $rsmvopen->Fields('DESCRIPTION'))){
echo 'yes';
}

I can get John and Doe but I can't get 'John Doe'. How do you account for the space? Thanks

fintan.

chriswragg

4:22 pm on Nov 11, 2005 (gmt 0)

10+ Year Member



No sure exactly but take a look at this reference site [regular-expressions.info], I'm sure it will be on there somewhere.

fintan

4:50 pm on Nov 11, 2005 (gmt 0)

10+ Year Member



Thanks for that I'll take a nosey