Reputation: 83
I made a form for a website where user posts data. For filtering and validation the string I wrote 3 functions for that but now its seems ugly when i call 3 functions in different lines. The data coming through the post method. I am not talking about nested functions here.
Can I call A function within another function like this?
php:
function apple($dates) {
return $dates;
}
function mango($sause) {
$mango = apple($sause);
return $mango;
}
Upvotes: 0
Views: 43
Reputation: 310983
In a word - yes. A function's code can definitely call another function.
Upvotes: 3