How to cast variable to array

前端 未结 8 2006
抹茶落季
抹茶落季 2020-12-17 07:54

I have a variable $v that can be either single string or array of strings
and I have a code:

$a = array();
if (is_array($v)) {
    $a = $v;
} else {
    $         


        
8条回答
提交回复
热议问题