I have a variable $v that can be either single string or array of stringsand I have a code:
$a = array(); if (is_array($v)) { $a = $v; } else { $
$a = (array) $v;
is the answer.