|
Posted by Hero Wanders on 09/30/05 03:48
Hello!
> preg_match("/PPC/i", "$agent")
^ ^
IMO you should use >$agent< instead of >"$agent"<.
Furthermore you are only doing a check whether one string is in another.
Use stripos (PHP5), strpos in combinanation with strtolower or stristr
for this.
IIRC the second is the fastest for PHP4.
if (strpos(strtolower($agent), 'ppc') !== false) {
// ...
}
http://php.net/strpos
http://php.net/stripos
http://php.net/strstr
http://php.net/stristr
http://php.net/strtolower
Greetings,
Hero Wanders
Navigation:
[Reply to this message]
|