I am trying to add up the character length from an inserted URL. I have grabbed all the selected URLs from the database in an array and am trying to add them up in a foreach function.
function countLen($email) {
$countLen = mysql_query("SELECT url FROM urls WHERE user='$email'");
$resultLen = mysql_result($countLen, 0);
foreach($resultLen as &$string) {
$length = strlen($string);
$totallen = ($totallen + $length);
return $totallen;
}
}