コード例 #1
0
ファイル: css_selector.php プロジェクト: ahmed555/Cupcake
 public function select($selector, $as_array = true)
 {
     $elements = $this->xpath->evaluate(selector_to_xpath($selector));
     return $as_array ? elements_to_array($elements) : $element;
 }
コード例 #2
0
ファイル: test.selector.php プロジェクト: 13leaf/php-selector
function test($selector, $expected)
{
    $actual = selector_to_xpath($selector);
    print $actual == $expected ? '.' : "\n '{$selector}' \n    expected '{$expected}' \n    but got  '{$actual}'\n\n";
}