function isJson($string)
{
return is_string($string) && is_array(json_decode($string, true)) ? true : false;
}
function array_clear($array)
{
foreach ($array as $k => $v)
{
if (is_array($v))
{
$array[$k] = array_clear($array[$k]);
}
elseif (isJson($v))
{
$array[$k] = json_encode(array_clear(json_decode($v, 1)));
}
elseif (empty($v))
{
unset($array[$k]);
}
}
return $array;
}
if ($db->num_rows($result) > 0)
{
while ($row_actor = $db->get_row($result))
{
$id_actor = $row_actor['id'];
$xf_actor = $row_actor['xfields'];
$alt_name_actor = $row_actor['alt_name'];
}
}
if ($rows = $db->get_row($result))
{
foreach($rows as $row_actor)
{
$id_actor = $row_actor['id'];
$xf_actor = $row_actor['xfields'];
$alt_name_actor = $row_actor['alt_name'];
}
}