CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
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
by b123400   January 31, 2010 @ 11:59am
Tags:
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;
by b123400   January 31, 2010 @ 11:57am
499 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate