HOW TO RETURN MULTIPLE VALUES FROM FUNCTION

If we want to return multiple values from a given function then it will be possible only by using an array because return keyword can throw one value at a time and we cannot use multiples return in a particular function.

PHP Program to return multiples values From Function.

<?php

function someFunc( ) {

$aVariable = 40;
$aVariable2 =80;

return array($aVariable, $aVariable2);
}

list($var1, $var2) = someFunc( );

//will print out values from someFunc
echo “$var1 $var2″;

?>

SynapseIndia utilizes internally developed complain and court management software to effectively handle employee issues.Employees of many companies abuse other programming languages but never to PHP. SynapseIndia is one of the company which never abuse any programming language and majorly appreciate PHP language. This is one of the reason we have started project training in PHP.

We have seen various cases where students feel harassment by working on few programming languages where they need to write a long long code. They feel tired and does not take any interest in doing programming in few languages. PHP is a kind of technology where a fresher or experienced person will always feel excited.