“Função PHP retorna valores múltiplos” Respostas de código

Função PHP retorna valores múltiplos

// Function to swap two numbers 
function swap( $x, $y ) {  
    return array( $y, $x ); 
}  
Homely Hamerkop

PHP retorna várias variáveis ​​da função

<?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();

?>
Scary Shark

Respostas semelhantes a “Função PHP retorna valores múltiplos”

Perguntas semelhantes a “Função PHP retorna valores múltiplos”

Mais respostas relacionadas para “Função PHP retorna valores múltiplos” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código