Calling function dynamic!?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

Calling function dynamic!?

Post by jmansa »

I'm trying to get this to work, but I'm doing something wrong? Please help...

Code: Select all

$getFunction = urlencode($_GET['ga']);
 
function $getFunction(){
    include("functions/function.".$getFunction.".php");
}
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Calling function dynamic!?

Post by mattpointblank »

Don't do it that way.

Code: Select all

 
$filename = urlencode($_GET['ga']);
 
function yourFunctionName($filename){
    include("functions/function.$filename.php");
}
 
Post Reply