Format:
Recent snippets for: b123400
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//the url of api
$url="http://api.xn--jj0a.jp/generate.json";
curl_setopt($ch, CURLOPT_URL, $url);
//I dont know why but I have to set the agent or it will return 403
$useragent="Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/532.6 (KHTML, like Gecko) Chrome/4.0.267.0 Safari/532.6";
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
//the query , for more detail: http://jamadam.com/blog/?b=3557
380 Views
no comments
<?php function search_string($start , $end , $from, $number=1){ if($number<1){ $number=1; } $from = trim(str_replace("\r\n","",$from)); $i = 0; $ans = $from; if(!stristr($ans , $start)){ return false;
499 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
