Benim script.php kabul $_POST giriş ve bir dize echos.
$theinput = $_POST['theinput'];
$output = //some processing;
echo $output;
Ben farklı bir dosya second.php başka bir işlevi aynı kodu gerekir ve kod tekrarlamak istemiyorum. Ama ilk komut script.php $_POST olarak girişini bekliyor. Fonksiyonunda Benim girdi $_POST sadece normal bir parametre değil.
function processinput($someinput){
//run the same script above,
//just the input is a parameter, not a `$_POST`
}
Nasıl bunu yapmak için herhangi bir fikir? Bir $_POST ya da böyle bir şey taklit etmek mümkün mü?