<?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();
?>
没问题.
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();
?>
没问题.
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();
?> 没有问题。