<?php
class   ProcessInterface
{
function   performProcess()
{
$input   =   array();
$input[ 'cmd']   =   '';
$input[ 'process']   =   '';
foreach   ($_POST   as   $n   =>   $v)   { //   POST
$input[$n]   =   $v;
}
echo   $input[ 'cmd'];         //test
}
}
ProcessInterface::performProcess();
?>
没问题.

解决方案 »

  1.   

    <?php
    class ProcessInterface
    {
        public function ProcessInterface()
        {
            $input = array();
            $input['cmd']       =   '';
            $input['process']   =   '';
            
            foreach ($_POST as $n => $v)
            {
                $input[$n] = $v;
            }
            
            echo $input['cmd'];
        }
    }$interface = new ProcessInterface;
    $interface->ProcessInterface();
    ?> 没有问题。