Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $curl = curl_init( $communityUrl . '/core/members/' );
- curl_setopt_array( $curl, array(
- CURLOPT_RETURNTRANSFER => TRUE,
- CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
- CURLOPT_USERPWD => "{$apiKey}:"
- ) );
- $response = curl_exec( $curl );
- $data = json_decode($response, true);
- $count = 0;
- foreach($data as $member) {
- if (is_array($member)) {
- foreach($member as $name) {
- if($count > 4)
- return;
- echo '<p class="top-member-p"><a href="'.$name['profileUrl'].'">'.ucfirst($name['name']).'</a> has '.$name['posts'] . ' posts</p>';
- $count++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement