Public feed #602930

Stuff

public text v1 · immutable
Raw Edit
·published 2007-07-04 11:48 UTC
rendered paste body
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://www.amazon.com/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$data = curl_exec($ch);

$pat = "/(href.{3})([a-zA-Z0-9].+)('|\")/";
$rep = "href='http://www.amazon.com/$2'";
      
$output = preg_replace($pat, $rep, $data);  

curl_close($ch);

echo $output;

?>