Doubt about require_once for multiple classes

Asked

Viewed 22 times

1

Is there a way to require multiple classes using just one require_once? I believe that not then I was doing a function and another doubt arose, func_get_args returns an array?

  • Yes, returns an array containing a list of arguments of the function

1 answer

0

I took the test here and it worked.

Function:

function multipleRequire(){
$archives = func_get_args();
$c = func_num_args();

for ($i = 0;$i<$c;$i++){
    $name = ($archives[$i] . ".php");
    require_once("$name");
}

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.