Re: [PHP] Regexp trouble

2005-11-24 Thread Frank Armitage
Andy Pieters wrote: > > Err.. why NOT use character classes? What is easier [0-9] or \d or maybe > [a-zA-Z] or [\w], ... ? > Well, first of all the square brackets in [\w] aren't needed, \w already means 'any "word" character'. Secondly, [a-zA-Z] is not the same as \w: " A "word" character i

Re: [PHP] Regexp trouble

2005-11-24 Thread Frank Armitage
Andy Pieters wrote: > Hi list > > I still fail to understand why regular expressions are causing me such a hard > time. > > Hi! Why don't you use 'preg_match'? And why do you use all those character classes? This: $subject = 'Nov 22 06:51:36'; $pattern = '/^(\w{3})\s(\d{2}

Re: [PHP] Is there a way to determine wich browser a visitor uses in php?

2005-11-23 Thread Frank Armitage
twistednetadmin wrote: > Thanks guys. That helps alot! > > But this: > print $_SERVER['HTTP_USER_AGENT']; > ?> > > Returned this using Mozilla: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; > rv:1.7.12) Gecko/20050915 Firefox/1.0.7 > And this using IE: Mozilla/4.0 (compatible; MSIE 6.0; Window