フォームがあり、URLは次のようになっています。
http://hostname/projectname/classname/methodname/variablename
そして、私のJavaScriptでは、次のような配列を入力します。
var currentrelations = new Array();
$(".ioAddRelation").each(function(index) {
currentrelations[index] = $(this).html();
});
そして、この配列には2つの値があります['eeeeee','eeeeee']
したがって、URLは次のとおりです。
http://localhost/Mar7ba/InformationObject/addIO/eeeeee,eeeeee
そして私のPHPでは、クラスInformationObjectで、メソッドaddIOで:
public function addIO($currentRelations =null) {
$name = $_POST['name'];
$type = $_POST['type'];
$concept = $_POST['concept'];
$contents = $_POST['contents'];
$this->model->addIO($name, $type, $concept, $contents);
if (isset($_POST['otherIOs'])) {
$otherIOs = $_POST['otherIOs'];
$this->model->addOtherIOs($name, $otherIOs);
}
$NumArguments = func_num_args();
if ($currentRelations!=null) {
$IOs = $_POST['concetedIOs'];
$this->model->setIoRelations($name,$IOs, $currentRelations);
}
exit;
include_once 'Successful.php';
$s = new Successful();
$s->index("you add the io good");
}
しかし、$currentRelations
このステートメントを使用して配列を出力すると、次のようになります。
echo count($currentRelations)
結果はでした。この1 not 2
ステートメントecho $currentRelations[0]
を使用して最初の要素を印刷すると、次のようになります。e not eeeeee
何故ですか?解決策は何ですか?私は何が間違っているのですか?