How can I access to a variable within a function which defined in another function?
For example:
<?php
function a() {
$fruit = "apple";
function b(){
$country="USA";
// How can I here access to $fruit
}
// And how can I here access to $country
}
?>
$fruitas an argument to yourb()-function. You then return$countryfrom yourb()function and use the response.