Last active
January 20, 2016 23:39
-
-
Save NaokiStark/1bfac48cf193d9066818 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://www.taringa.net/ajax/mentions/user'; | |
$fields = array( | |
'uid' => '25854531' //Id del usuario | |
); | |
$fields_string=""; | |
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } | |
rtrim($fields_string, '&'); | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL, $url); | |
curl_setopt($ch,CURLOPT_POST, count($fields)); | |
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
$data = json_decode($result,true); | |
echo $data['data']['userStatus']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fabi ♥