调用函数并通过url PHP传递参数

This is my PHP script:

<?php

function myFunc($param1)
{
echo $param1;
}

if(isset($_GET['action'])){
    if(function_exists($_GET['action'])) {    
        $_GET['action']();
    }
}

?>

Now I want call this function from other php and pass parameter:

http://localhost/data.php?action=myFunc

How to pass parameter to myFunc through url?

It is most certainly wrong and insecure (imagine what would happen if you tried calling it with action=unlink&param=somefile.php), but you could do something like:

With URL: http://localhost/data.php?action=myFunc&param=123

<?php

function myFunc($param1)
{
echo $param1;
}

if(isset($_GET['action'])){
    if(function_exists($_GET['action'])) {    
        $_GET['action']($_GET['param']);
    }
}