테스트 사이트 - 개발 중인 베타 버전입니다

xml방식에 기록된 정보를 가져올때... 채택완료

amkor 10년 전 조회 4,282

</p><p><span style="font-size: 14.6666669845581px; line-height: 1.5;"><YNewsML> </span><span style="font-size: 11pt; line-height: 1.5;">​</span></p><p>    <Metadata></p><p>           <Urgency>3</Urgency></p><p>           <Source>ㅇㅇㅇ</Source>  </p><p>    </Metadata></p><p>   <NewsContent></p><p>       <LangType>KR</LangType></p><p>        <AppendData mimetype="image/jpeg"></p><p><span class="Apple-tab-span" style="white-space:pre">			</span><Title>제목</Title>                                  </p><p><span class="Apple-tab-span" style="white-space:pre">			</span><FileName>파일이름</FileName>   //제가 추출 하고 싶은 정보입니다ㅜㅜ</p><p><span class="Apple-tab-span" style="white-space:pre">			</span><Href>경로</Href></p><p><span class="Apple-tab-span" style="white-space:pre">		</span></AppendData></p><p><span class="Apple-tab-span" style="white-space:pre">	</span></NewsContent></p><p></YNewsML> </p><p> </p><p>=====================================</p><p> </p><p>foreach ($xml->Metadata as $value) {</p><p>  <span class="Apple-tab-span" style="white-space:pre">	</span>$<span style="font-size: 14.6666669845581px; line-height: 1.5;">Urgency</span><span style="font-size: 11pt; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">= reset($value-></span><span style="font-size: 14.6666669845581px; line-height: 1.5;">Urgency</span><span style="font-size: 11pt; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">);  //출력됨</span></p><p> </p><p><span style="font-size: 11pt; line-height: 1.5;">}</span></p><p> </p><p><span style="font-size: 14.6666669845581px; line-height: 1.5;">foreach ($xml-></span><span style="font-size: 14.6666669845581px; line-height: 1.5;">NewsContent</span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​ as $value) {</span><span style="font-size: 11pt; line-height: 1.5;">​</span></p><p><span style="font-size: 11pt; line-height: 1.5;">     </span><span style="font-size: 14.6666669845581px; line-height: 1.5;">$</span><span style="font-size: 14.6666669845581px; line-height: 1.5;"></span><span style="font-size: 14.6666669845581px; line-height: 1.5;">LangType</span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">​    </span><span style="font-size: 11pt; line-height: 1.5;">= reset($value-></span><span style="font-size: 14.6666669845581px; line-height: 1.5;"></span><span style="font-size: 14.6666669845581px; line-height: 1.5;">LangType</span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">);  //출력됨</span><span style="font-size: 11pt; line-height: 1.5;">​</span></p><p><span style="font-size: 11pt; line-height: 1.5;">     </span><span style="font-size: 14.6666669845581px; line-height: 1.5;">$</span><span style="font-size: 14.6666669845581px; line-height: 1.5;"></span><span style="font-size: 14.6666669845581px; line-height: 1.5;"></span><span style="font-size: 14.6666669845581px; line-height: 1.5;">AppendData</span><span style="font-size: 14.6666669845581px; line-height: 1.5;"> </span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​</span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">= reset($value-></span><span style="font-size: 14.6666669845581px; line-height: 1.5;"></span><span style="font-size: 14.6666669845581px; line-height: 1.5;"></span><span style="font-size: 14.6666669845581px; line-height: 1.5;">AppendData</span><span style="font-size: 14.6666669845581px; line-height: 1.5;"> </span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​</span><span style="font-size: 14.6666669845581px; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">​</span><span style="font-size: 11pt; line-height: 1.5;">);  //여기가 출력이 안되요 ㅠ,ㅠ </span></p><p><span style="font-size: 11pt; line-height: 1.5;">     // 제가 원하는 것은 </span><span style="font-size: 14.6666669845581px; line-height: 1.5;">FileName을 출력하고 싶은데 지금 출력하는것보다 더 아래? 라서 ㅠ,ㅠ 어떻게 출력해야 할지 모르겠습니다, ㅠ,ㅠ</span><span style="font-size: 11pt; line-height: 1.5;">​</span></p><p> </p><p><span style="font-size: 14.6666669845581px; line-height: 1.5;">}</span><span style="font-size: 11pt; line-height: 1.5;">​</span></p><p>

 

 

제가 원하는 것은 FileName을 출력하고 싶은데 기존에 출력하는것보다 더 아래? 라서 ㅠ,ㅠ 어떻게 출력해야 할지 모르겠습니다, ㅠ,ㅠ

 

부탁드립니다.ㅠㅜ ㅠ

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

참고1

foreach($xml->NewsContent->AppendData->FileName as $key => $value)

{

    echo $value;

 

 

참고2

foreach($xml->NewsContent->AppendData as $k => $v)

{

foreach($v as $key => $value)

{

echo $value." ";

}

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인