function add(y,z){
function fn(x,y,z){
console.log(Math.round(x+y)*z);
};
fn(this.x,y,z);
};
add.call({x: 20.1},3.1,5.1); // 117.3
add.apply({x: 20.1},[3.1,5.1]); // 117.3
All about very small logical and programming problems. Complex theories made simple to understand
$url = "https://www.googleapis.com/urlshortener/v1/url"; $strPost = '{"longUrl": "YOUR LONG URL"}'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //if your are using proxy url use proxy setting // curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_HTTPGET,1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/json")); //since i am requesting json response curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POSTFIELDS, $strPost); // add POST fields curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); var_dump($result); curl_close($ch); exit; If you dont want to use the google url shortner want to create your own check it here : http://opendummies.blogspot.in/2014/07/creating-url-shortner.html |
FB.init({ appId : 'YOUR_APP_ID', frictionlessRequests : true });
function sendRequestViaMultiFriendSelector() { FB.ui({method: 'apprequests', message: 'My Request' }, callbackfunction()); }
callbackfunction(response){
alert(response);
}
Array
(
[scheme] => http
[host] => hostname
[user] => username
[pass] => password
[path] => /path
[query] => arg=value
[fragment] => anchor
)
reference - http://in2.php.net/manual/en/function.parse-url.php