With this snippet I get some related tags in a tag cloud (random keywords like on a blog)
function cloudTags($cloudquery)
{
global $config;
$tags = array();
$cloud = array();
$query = mysql_query($cloudquery);
while($t = mysql_fetch_array($query)) {
$db = explode(' ', $t[0]);
while(list($key, $value) = each($db)){
$keyword[$value] += 1;
}
}
This code works perfectly and gives me random tags, but, in my error log, I get PHP notices for each and every tag!
[Tue Aug 05 00:33:55 2008] [error] [client 90.145.16.29] PHP Notice: Undefined index: volvo in /var/www/httpdocs/include/function.php on line 580
Line 580 corresponds with the
$keyword[$value] += 1;
above
I tried to enclose the $value in quotes but that makes the whole function invalid....
Can anyone point me in the right direction?