Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

dom domxpath evaluate function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php dom domxpath evaluate () function

Write your php code

 
<?php ?>

Php Result


Your code below



DOMXPath->evaluate() --  Evaluates the given XPath expression and returns a typed result if possible.

Syntax

class DOMXPath {

mixed evaluate ( string expression [, DOMNode contextnode] )

}

Executes the given XPath expression and returns a typed result if possible.

Parameters

expression

The XPath expression to execute.

contextnode

The optional contextnode can be specified for doing relative XPath queries. By default, the queries are relative to the root element.

Return Values

Returns a typed result if possible or a DOMNodeList containing all nodes matching the given XPath expression.

Examples

Example 1. Getting the count of all the english books

<?php

$doc
= new DOMDocument;

$doc->load('book.xml');

$xpath = new DOMXPath($doc);

$tbody = $doc->getElementsByTagName('tbody')->item(0);

// our query is relative to the tbody node
$query = 'count(row/entry[. = "en"])';

$entries = $xpath->evaluate($query, $tbody);
echo
"There are $entries english books\n";

?>

The above example will output:

There are 2 english books

Php dom domxpath evaluate Function syntax tag

dom domxpath evaluate php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php dom domxpath evaluate syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online