+ 1
What is "return function " ? Reason for using it ... It's function ?
4 odpowiedzi
+ 2
it use to send data to a new variable where you need that, and suppose you want to use some function that use to get some unique string from a file, and than want to store that string in MySQL.
If you don't use return value, than you have to write it again and again. Writing function for a particular job increase your programing performance.
+ 1
I have no clue about php, but since it is general logic the answer is: To return a value. For instance you have a function that calculates something for you, so you expect a return value to store the result somewhere. Or you have something that reads or converts a file line by line and you get a string array/list back as return value.
0
where is the value returned ? why should we return the value ? :'(
0
return function is used to return the value
,<?php
function subtract($x,$y)
{
return($x-$y);
}
echo subtract(10,5);
?>