Curl edit!
This commit is contained in:
parent
e59521f689
commit
4c8e433898
1 changed files with 12 additions and 12 deletions
|
@ -1,16 +1,16 @@
|
|||
|
||||
<h1>Tets!</h1>
|
||||
<h1>Test!</h1>
|
||||
|
||||
<?php
|
||||
$url=$_POST['txturl'];
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||
$output = curl_exec($ch);
|
||||
echo $output;
|
||||
curl_close($ch);
|
||||
?>
|
||||
|
||||
<?php
|
||||
$url = "http://www.reddit.com/";
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$var= curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$third= stripos($var,'<p class="title"><a class="title " ',0);
|
||||
$fourth= stripos($var,'</span></p>',0);
|
||||
|
||||
//echo substr($var,$first,$second-$first);
|
||||
echo substr($var,$third,$fourth-$third);
|
||||
echo function_exists('curl_version')?'Yes':'No';
|
||||
?>
|
Reference in a new issue