[ create a new paste ] login | about

Link: http://codepad.org/CLdE8XCQ    [ raw code | output | fork | 1 comment ]

PHP, pasted on May 25:
1
2
3
4
5
6
7
8
<?php

  $cntnt = "<div><div title='news alert'>Click here</div></div>";
  $dcmnt = new DOMDocument(); $dcmnt->loadHTML( $cntnt );
  $xpath = new DOMXPath( $dcmnt );
  $match = $xpath->query("//div[@title='news alert']");

  echo $match->length ? "Found" : "Not Found" ;


Output:
1
Found


Create a new paste based on this one


Comments:
posted by gangarani on Oct 2
good
reply