After months of use my application form suddenly stopped with this error:
Warning: strip_tags() expects parameter 1 to be string, array given in /home/useraccoun
Well, it's obvious - your $_POST[$key]
as array and not string. So you need to decide what do do in terms of logic of your application. I can suggest:
if(is_scalar($_POST['$key']))
{
//treat any scalar value as string and do stuff:
$post->{$key} = trim(strip_tags($_POST[$key]));
}
else
{
//here you need to decide what to do with such things as arrays
}