function parent($key)
{
function son()
{
global $key;
}
}
I want to achieve this:
soncan access the$keyofparent
As it’s quite a simple function,I don’t want to change parent into a class
OK,I’ve been told that function are global anyway.Is there a way for son to get $key of parent then?
Since PHP 5.3 you can do:
About usort — are you looking for something like this?