Wildcard or contains operator in PHP

All web design questions, hints and solutions can be discussed here.

Moderators: fac51, 117, Chris

Post Reply
vinnieza
Allowed to Drink!!!!
Posts: 3258
Joined: Sun Mar 07, 2004 12:09 pm
Location: Pluto
Contact:

Wildcard or contains operator in PHP

Post by vinnieza »

hey all, Is it possible to get a wildcard in php or is there a contains operator in php?

What i'm trying to do is:

Code: Select all

    <?php 
global $userBrowser;
$userBrowser = $_SERVER['HTTP_USER_AGENT'];
$fx = "[wildcard]Firefox[wildcard]";
if($userBrowser==$fx)
I'm trying to make it so that if $userBorwser contains the word "firefox" to display a different code.

Thanks, hope you understand.
Image
....................My site: www.vthemes.co.uk
.........................* no questions asked *

Image
vinnieza
Allowed to Drink!!!!
Posts: 3258
Joined: Sun Mar 07, 2004 12:09 pm
Location: Pluto
Contact:

Post by vinnieza »

I've fixed it now and edd has tested it for me (thanks edd).

I used:

Code: Select all

$pos = strpos($_SERVER['HTTP_USER_AGENT'],"Firefox");
  if (!($pos===false))
Thanks to greg8872 at phpaddict.com for the code.
Image
....................My site: www.vthemes.co.uk
.........................* no questions asked *

Image
Post Reply