arthurkushman /
querypath
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Parsing PHP with QueryPath |
||
| 4 | * |
||
| 5 | * This file contains an example of how QueryPath can be used |
||
| 6 | * to parse a PHP file. Any well-formed XML or HTML document can be parsed. Since |
||
| 7 | * PHP tags are contained inside of processor instructions, an XML parser can |
||
| 8 | * correctly parse such a file into a DOM. Consequently, you can use QueryPath |
||
| 9 | * to read, modify, and traverse PHP files. |
||
| 10 | * |
||
| 11 | * This example illustrates how such a file can be parsed and manipulated. |
||
| 12 | * |
||
| 13 | * |
||
| 14 | * @author M Butcher <[email protected]> |
||
| 15 | * @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license. |
||
| 16 | */ |
||
| 17 | ?> |
||
| 18 | <html> |
||
| 19 | <head> |
||
| 20 | <title>Parse PHP from QueryPath</title> |
||
| 21 | </head> |
||
| 22 | <body> |
||
| 23 | <?php |
||
| 24 | require '../src/QueryPath/QueryPath.php'; |
||
| 25 | |||
| 26 | // Parse this file with QueryPath. |
||
| 27 | print qp(__FILE__, 'title')->text(); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 28 | ?> |
||
| 29 | </body> |
||
| 30 | </html> |