각 배열 값의 시작 부분에 <p>
태그를 추가하고 각 배열 값 끝에 </p>
태그를 닫아야합니다. [
또는 ]
구분 기호 다음이 있다면배열의 값 바꾸기
그들은 위의 배열이되어야 <p class="myclass">
Array
(
[0] => [This is a line of text
[1] => and another
[2] => and yet another.] [This is another line of text
[3] => and another
[4] => and another] [OK, so you get the idea.
)
로 대체해야합니다
Array
(
[0] => <p class="myclass">This is a line of text</p>
[1] => <p>and another</p>
[2] => <p>and yet another.</p> <p class="myclass">This is another line of text</p>
[3] => <p>and another</p>
[4] => <p>and another</p> <p class="myclass">OK, so you get the idea.</p>
)
질문입니다 : 어떻게 foreach 루프를 사용하여 첫 번째 배열에서 두 번째 배열로 이동합니까?
귀하의 질문에 당신이 할 정확히 무엇을하고 싶은데, 매우 혼란? –