mirror of
https://github.com/php/php-src.git
synced 2024-10-03 07:46:12 +00:00
25 lines
580 B
Plaintext
25 lines
580 B
Plaintext
|
--TEST--
|
||
|
Accessing attributes of a node
|
||
|
--SKIPIF--
|
||
|
<?php if (!extension_loaded("tidy") || !class_exists("tidy_doc")) print "skip"; ?>
|
||
|
--POST--
|
||
|
--GET--
|
||
|
--INI--
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$a = tidy_parse_string("<HTML><BODY BGCOLOR=#FFFFFF ALINK=#000000></BODY></HTML>");
|
||
|
$body = $a->body();
|
||
|
var_dump($body->attribute);
|
||
|
foreach($body->attribute as $key=>$val) {
|
||
|
echo "Attrib '$key': $val\n";
|
||
|
}
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
array(2) {
|
||
|
["bgcolor"]=>
|
||
|
string(7) "#FFFFFF"
|
||
|
["alink"]=>
|
||
|
string(7) "#000000"
|
||
|
}
|
||
|
Attrib 'bgcolor': #FFFFFF
|
||
|
Attrib 'alink': #000000
|