« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for substring (0.001 sec.)
DOMXPath::registerPhpFunctionNS — PHP の関数を、名前空間付きの XPath 関数として... 9414
DOMXPath::registerPhpFunctionNS (PHP >= 8.4.0) DOMXPath::registerPhpFunctionNS — PHP の関数を、名前空間付きの XPath 関数として登録する 説明 public function DOMXPath::registerPhpFunctionNS ( string $namespaceURI , string $name , callable $ca ... ath -> registerNamespace ( "my" , "urn:my.ns" ); // Register PHP function $xpath -> registerPHPFunctionNS ( 'urn:my.ns' , 'substring' , fn (array $arg1 , int $start , int $length ) => substr ( $arg1 [ 0 ]-> textContent , $start , $length ) ); // Call subs ... tr function on the book title $nodes = $xpath -> query ( '//book[my:substring(title, 0, 3) = "PHP"]' ); echo "Found { $nodes -> length } books starting with 'PHP':\n" ; foreach ( $nodes as $node ) { $ ...
https://man.mtool.work/php/8.3/domxpath.registerphpfunctionns.html
PREV 1 NEXT