You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo'Add the attribute <code>class="cell"</code> to all <code><td></code> elements:';
30
+
31
+
echo'<pre><code>';
32
+
33
+
echohtmlspecialchars(
34
+
html5qp($html, 'td')
35
+
->attr('class', 'cell')
36
+
->top() // return to <html> tag
37
+
->innerHTML5() // get mark-up without <html>. Use ->html5() to return a valid HTML document (Doctype and all)
38
+
);
39
+
40
+
echo'</code></pre>';
41
+
42
+
echo'<h2>Example 2</h2>';
43
+
echo'Use <code>html5qp($html)->find(\'#row2 > td:nth-child(2)\')->text();</code> to display the contents of the second <code><td></code> in the second <code><tr></code>: <br><strong>';
44
+
45
+
echohtml5qp($html)
46
+
->find('#row2 > td:nth-child(2)')
47
+
->text();
48
+
49
+
echo'</strong>';
50
+
51
+
echo'<h2>Example 3</h2>';
52
+
echo'Append another row to the HTML and output the results:';
echo'Add the attribute <code>class="item"</code> to all <code><desc></code> elements:';
95
+
96
+
echo'<pre><code>';
97
+
98
+
echohtmlspecialchars(
99
+
qp($xml, 'desc')
100
+
->attr('class', 'item')
101
+
->top() // return to the <categories> tag
102
+
->xml() // output a valid XML document. Use ->innerXML() to get the contents of <categories /> instead.
103
+
);
104
+
105
+
echo'</code></pre>';
106
+
107
+
echo'<h2>Example 2</h2>';
108
+
echo'Use <code>qp($xml)->find(\'categories > category:nth-child(3) desc\')->text();</code> to display the contents of the third <code><desc></code>: <br><strong>';
109
+
110
+
echoqp($xml)
111
+
->find('categories > category:nth-child(3) desc')
112
+
->text();
113
+
114
+
echo'</strong>';
115
+
116
+
echo'<h2>Example 3</h2>';
117
+
echo'Append another category to the XML and output the results:';
0 commit comments