Hi !
I've got this function:
$Length = 10;
if(strlen($violation) > $Length){
preg_match('/[a-zA-Z0-9]{0,'.$Length.'}/', $violation, $M);
$violation= $M . '...';
}
The function works fine if $violation is just a string. But it isn't, it an array. I use it like this:
while($row=mysql_fetch_array($result))
{
$violation=$row["violation"];
$Length = 10;
if(strlen($violation) > $Length){
preg_match('/[a-zA-Z0-9]{0,'.$Length.'}/', $violation, $M);
$violation = $M . '...';
}
print $violation;
}
How do i get it to work ?