好的,所以我弄明白了:)多亏了你的例子,它现在才能正常工作。
class Test_Class {
public function Test_Function_1(array $Test_Array_1) {
echo'TF1_Var_1 = '. $Test_Array_1['TF1_Var_1'] . '<br> <br>';
}
public function Test_Function_2($Test_Selector_2, array $Test_Array_2) {
echo'Test_Selector_2 = '. $Test_Selector_2 . '<br>';
echo'TF2_Var_1 = '. $Test_Array_2['TF2_Var_1'] . '<br>';
}
}
$Test_Run = new Test_Class();
$Test_Run->Test_Function_1([ 'TF1_Var_1' => 'TF1_Val_1', 'TF1_Var_2' => 'TF1_Val_2', 'TF1_Var_3' => 'TF1_Val_3' ]);
$Test_Run->Test_Function_2('TF2_Selector_Data' , [ 'TF2_Var_1' => 'TF2_Val_1', 'TF2_Var_2' => 'TF2_Val_2', 'TF2_Var_3' => 'TF2_Val_3' ]);
我实际上没有意识到你可以将数组传递给函数,我以前没有遇到过这样的例子,所以我不知道这是可能的。我以为你只能用逗号来分隔字符串,所以谢谢你。
https://stackoverflow.com/questions/50779543
复制相似问题