Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?php require("urlencodinglib.php"); $name = $_GET['name']; $s = "http://slikleksikon.org/".$name; function get_content($url) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); ob_start(); curl_exec ($ch); curl_close ($ch); $string = ob_get_contents(); ob_end_clean(); return $string; } $content = get_content ($s); $pattern ='/\">(.*)<\/a>\?/i'; preg_match($pattern,$content,$matches); $ret = $matches[1]; echo encodeURIComponent($ret); ?>
This paste will be private.
From the Design Piracy series on my blog: