How to access the elements of a function's return array?

后端 未结 15 2249
栀梦
栀梦 2020-12-05 03:46

I need to return multiple values from a function, therefore I have added them to an array and returned the array.



        
15条回答
  •  甜味超标
    2020-12-05 04:12

    Maybe this is what you searched for :

    function data() {
        // your code
        return $array; 
    }
    $var = data(); 
    foreach($var as $value) {
        echo $value; 
    }
    

提交回复
热议问题