Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/D TD/xhtml11.dtd">
- <html>
- <head>
- <title>cURL DEMO</title>
- <style type="text/css" media="all">
- @import url("http://static.php.net/www.php.net/styles/site.css");
- @import url("http://static.php.net/www.php.net/styles/phpnet.css");
- </style>
- <!--[if IE]><![if gte IE 6]><![endif]-->
- <style type="text/css" media="print">
- @import url("http://static.php.net/www.php.net/styles/print.css");
- </style>
- <style type="text/css">
- .phpquote {
- border: solid;
- height: 300px;
- left: 50px;
- overflow-y: scroll;
- padding: 5px;
- position: absolute;
- right: 50px;
- }
- </style>
- </head>
- <body>
- <a href="?function=echo">echo</a><br/>
- <a href="?function=md5">md5</a><br/>
- <a href="?function=nl2br">nl2br</a><br/>
- <hr/>
- <?php
- if(isset($_GET['function']) && $_GET['function'] != '')
- {
- $url = 'http://www.php.net/manual/en/function.'.$_GET['function'].'.php';
- $curl_handler = curl_init($url);
- curl_setopt($curl_handler, CURLOPT_HEADER, false);
- ob_start();
- curl_exec($curl_handler);
- $result = ob_get_contents();
- ob_end_clean();
- curl_close($curl_handler);
- echo 'Manual (from <a href="http://www.php.net/" target="_blank">PHP Web Site</a>) :<br/>'."\n";
- echo '<hr/>'."\n";
- echo '<div class="phpquote">'."\n";
- $result = substr($result, strpos($result, '<div id="function.'.$_GET['function'].'" class="refentry">'));
- $result = substr($result, 0, strpos($result, '<div class="foot">'));
- $result = substr($result, 0, strpos($result, '<!--UdmComment-->')).substr($result, strpos($result, '<!--/UdmComment-->'));
- $result = trim($result);
- echo $result."\n";
- echo '</div>'."\n";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement