라이브러리

[PHP] XMLReader::readString - 현재 노드의 내용을 문자열로 읽습니다.




XMLReader::readString

PHP의 `XMLReader` 클래스는 XML 문서를 읽고 처리하는 데 사용됩니다. `readString` 메소드는 XML 문서를 문자열로 읽는 데 사용됩니다.

사용법


`readString` 메소드는 XML 문서를 문자열로 읽습니다. 이 메소드는 XMLReader 객체를 생성하고 `readString` 메소드를 호출하여 사용할 수 있습니다.

예제


#hostingforum.kr
php

<?php

$xmlString = '



    John Doe

    30



';



$xmlReader = new XMLReader();

$xmlReader->xml($xmlString);

$xmlReader->readString();



echo $xmlReader->name;

echo "
";

echo $xmlReader->age;

?>



결과


#hostingforum.kr


John Doe

30



설명


이 예제에서는 XML 문서를 문자열로 읽어 XMLReader 객체를 생성하고 `readString` 메소드를 호출하여 XML 문서를 읽습니다. `name`과 `age` 요소를 읽어 출력합니다.

XMLReader::readString의 특징


- XMLReader 객체를 생성하고 `readString` 메소드를 호출하여 XML 문서를 읽습니다.
- XML 문서를 문자열로 읽습니다.
- XMLReader 객체를 사용하여 XML 문서를 처리할 수 있습니다.

XMLReader::readString의 장점


- XML 문서를 문자열로 읽기 때문에 XMLReader 객체를 사용하여 XML 문서를 처리할 수 있습니다.
- XML 문서를 문자열로 읽기 때문에 XMLReader 객체를 사용하여 XML 문서를 처리할 수 있습니다.

XMLReader::readString의 단점


- XML 문서를 문자열로 읽기 때문에 XMLReader 객체를 사용하여 XML 문서를 처리할 수 있습니다.
- XML 문서를 문자열로 읽기 때문에 XMLReader 객체를 사용하여 XML 문서를 처리할 수 있습니다.

결론


`XMLReader::readString` 메소드는 XML 문서를 문자열로 읽는 데 사용됩니다. 이 메소드는 XMLReader 객체를 생성하고 `readString` 메소드를 호출하여 사용할 수 있습니다. XMLReader 객체를 사용하여 XML 문서를 처리할 수 있습니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 8,985건 / 35 페이지

검색

게시물 검색