Perhaps you could put it on a webpage and ask a Mac user to see if it
works.
BTW, there is no reason to use preg_match for that. Instead use
strpos(), it is MUCH faster.
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Tom Malone) wrote:
> Sorry to bother you all with this, but I have no way to test this, as I have
> no access to a Mac. Could you tell me if this little piece of code looks as
> if it would work (detect whether someone's using the Mac OS)?
>
> if (preg_match("/mac/i", "$HTTP_USER_AGENT") || preg_match("/macintosh/i",
> "$HTTP_USER_AGENT") || preg_match("/ppc/i", "$HTTP_USER_AGENT") ||
> preg_match("/PowerPC/i", "$HTTP_USER_AGENT")):
> $basefont = "Geneva";
> else:
> $basefont = "Verdana, Helvetica, Serif";
> endif;
>
> It doesn't return an error, but that doesn't mean it works. I really
> appreciate your help. TIA
>
> Tom Malone
> Web Designer
> http://www.tom-malone.com
>
--
__________________________________
Gabe da Silveira, Web Designer
Twin Cities Student Unions
University of Minnesota
http://www.coffman.umn.edu
wFone: (612)624-7270
eMail: [EMAIL PROTECTED]
hPage: http://www.visi.com/~jiblet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]