My function is like this:
<?php
function facebook_friend_list($username){
............................................
............................................
echo "Number of friends:". $N ;
}
?>
My problem: I have to call This function like this :
facebook_friend_list($a);
facebook_friend_list();
facebook_friend_list($t);
............................
............................
inside a loop. So, sometimes this function is getting parameter and sometimes it is not getting. When it does not get parameter, it shows "Missing argument 1 for facebook_friend_list(), called in........................................................."
How to solve this problem?
function facebook_friend_list($username = '')or whatever default value you needNULLas parameter? If so, explicitly pass that, or make it the default param value in the function declaration. See php.net/manual/en/…