update : 2015.11.03
php.shukuma.com검색:
|
DOMXPath::registerPhpFunctions(PHP 5 >= 5.3.0, PHP 7) DOMXPath::registerPhpFunctions — Register PHP functions as XPath functions 설명This method enables the ability to use PHP functions within XPath expressions. 인수
반환값값을 반환하지 않습니다. 예제The following examples use book.xml which contains the following:
Example #1 book.xml <?xml version="1.0" encoding="UTF-8"?> <books> <book> <title>PHP Basics</title> <author>Jim Smith</author> <author>Jane Smith</author> </book> <book> <title>PHP Secrets</title> <author>Jenny Smythe</author> </book> <book> <title>XML basics</title> <author>Joe Black</author> </book> </books>
Example #2 DOMXPath::registerPHPFunctions() with php:functionString
<?php 위 예제의 출력 예시: Found 2 books starting with 'PHP': PHP Basics by Jim Smith PHP Secrets by Jenny Smythe
Example #3 DOMXPath::registerPHPFunctions() with php:function
<?php 위 예제의 출력 예시: Books with multiple authors: PHP Basics 참고
|