Expand|Select|Wrap|Line Numbers
- <\?[\w\W]*?\?>
Expand|Select|Wrap|Line Numbers
- <?php
- include("db.php");
- $name=$_REQUEST['name'];
- /* the regular expression to extract code inside php tags (i.e <? and ?>) is */
- $str='|<\?[\w\W]*?\?>|';
- # The regex can also be written using double quotes
- $str="|<\?[\w\W]*?\?>|";
- ?>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Sample PHP File</title>
- </head>
- <body>
- <?="<h1>Some output from PHP?>
- </body>
- </html>