I got this array (just a small piece of the total):
Code: Select all
<?
$robot = array (
"yell" => array(
"icon" => "yell",
"title" => "Yell",
"rule" => array(
"YellCrawl[ /]V?([0-9.]{1,10})" => "\\1",
"Yellbot[ /]Nutch-([0-9.]{1,10})" => "\\1",
)
),
"yodao" => array(
"icon" => "robot",
"title" => "Yodao",
"rule" => array(
"YodaoBot(-Image|)?[ /]([0-9.]{1,10})" => "\\2"
),
"uri" => "http://www.yodao.com/help/webmaster/spider/"
),
"yoogli" => array(
"icon" => "yoogli",
"title" => "Yoogli",
"rule" => array(
"yoogliFetchAgent[ /]([0-9.]{1,10})" => "\\1"
),
"uri" => "http://www.yoogli.com"
),
"yotta" => array(
"icon" => "robot",
"title" => "Yotta",
"rule" => array(
"Yotta(Shopping|Cars)_Bot[ /]([0-9.]{1,10})" => "\\2",
"OmniExplorer_Bot[ /]([0-9.]{1,10})" => "\\1"
),
"uri" => "http://www.yottacars.com"
)
);
?>Code: Select all
<?
foreach($robot as $value) {
if(preg_match('_'.preg_quote($value['rule'][1], '_').'_', $user_agent)) {
$webbot = $value['title'];
}
}
?>
Code: Select all
Notice: Undefined offset: 1 in C:\www\value.class.php on line 5398Thanks!