What it is that i'm trying to do, is take these strings :
and explode them into variable names based on their browser.Mozilla/4.0_(compatible;_MSIE_6.0;_Windows_98;_Q312461;_FunWebP )
so, here is what i've done so far :
Code: Select all
<?php
$Mozilla = array('Netscape/7%','Mozilla/6%','Mozilla/5%','Mozilla/4%','NSPlayer/4%','NSPlayer/7%','NSPlayer/9%');
for($i=0; $i<8; $i++)
{
$sql = "SELECT UserAgent, count(UserAgent) FROM log WHERE (UserAgent LIKE '".$Mozilla[$i]."') Group by UserAgent HAVING count(UserAgent) > 0";
$result = mysql_query($sql) or die(MySQL_Error());
$row = mysql_fetch_assoc($result);
$Moz_Found[$i] = $row['count(UserAgent)'];
$temp = explode(".",$row['UserAgent']);
##############################
## Since I couldn't get this to work, i tried ##
## seeing at least what the array table list ##
## looked like. The results are at the end ##
##############################
print_r($temp[0]);
echo '<br />';
}
?>the results, sadly, came back like this :
Array ( [0] => )
Array ( [0] => )
Array ( [0] => )
Array ( [0] => Mozilla/4 [1] => 0_(compatible;_MSIE_6 [2] => 0;_Windows_98;_Q312461;_FunWebP )
Array ( [0] => NSPlayer/4 [1] => 1 [2] => 0 [3] => 3854 )
Array ( [0] => NSPlayer/7 [1] => 1 [2] => 0 [3] => 3055 )
Array ( [0] => NSPlayer/9 [1] => 0 [2] => 0 [3] => 2980 )
Array ( [0] => )
see, what I need to do is assign each of the found array[0]'s that actually contain values to a seperate #, instead of just using 0 for all of them.. get what i mean?
in other words, when I use the echo command to view this array like this :
Code: Select all
<?php
//.....
echo $temp[0];
?>i get the following result :
instead of just getting Mozilla/4, making it impossible for me to use this...Mozilla/4NSPlayer/4NSPlayer/7NSPlayer/9
any help would be seriously appreciated.