Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php return multiple values

<?php
function small_numbers()
{
    return [0, 1, 2];
}
// Array destructuring will collect each member of the array individually
[$zero, $one, $two] = small_numbers();

// Prior to 7.1.0, the only equivalent alternative is using list() construct
list($zero, $one, $two) = small_numbers();

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #return #multiple #values
ADD COMMENT
Topic
Name
6+1 =