foreach loop
으로 parent form
안에 2 forms
을 생성하고 싶습니다. 자식 폼이 생성되기 전에 first form
이 생성되지 않고 parent form
이 끝나는 것이 이상합니다. 왜 그래야만하지?다른 양식 안에 foreach 루프가있는 양식 생성
<form action="" method="POST">
<?php
$array = [1,2];
foreach ($array as $arr) {
echo '<form action="" id="'.$arr.'" method="POST">
<input type="text" placeholder="hello">
</form>';
}
?>
</form>
은 다음과 같아야합니다 :이처럼 찾고
<form action="" method="POST">
<form action="" id="1" method="POST">
<input type="text" placeholder="hello">
</form>
<form action="" id="2" method="POST">
<input type="text" placeholder="hello">
</form>
</form>
:
<form action="" method="POST">
<input type="text" placeholder="hello">
</form>
<form action="" id="2" method="POST">
<input type="text" placeholder="hello">
</form>
귀하의 코드에 의해
<input type="text" placeholder="hello">
는 작동합니다으로 작동 - https://eval.in/600035 – splash58가 어디 출력을 확인하고 있습니다? 브라우저 또는 터미널 또는 다른 출력 형식 - PHP에서 생성 된 코드를 어디서 볼 수 있습니까? –
브라우저에서 확인하십시오. 이상하지만 그것은 이상한 결과를 내게주고있다. – marukobotto