Title: PHP code not working properly?
Last modified: January 7, 2017

---

# PHP code not working properly?

 *  [FinlayDaG33k](https://wordpress.org/support/users/finlaydag33k/)
 * (@finlaydag33k)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-code-not-working-properly-2/)
 * Hii There,
 * I installed this plugin to see if I can get my PHP script to work (i’ve tried
   a few others, but none worked the way I needed them to).
 * However, the output doesn’t show up at all, what is wrong?
 * this is my code:
    ` <?php function getKeybase($username){ $url = “[https://keybase.io/_/api/1.0/user/lookup.json?usernames=&#8221](https://keybase.io/_/api/1.0/user/lookup.json?usernames=&#8221);.
   $username; echo $url; if(function_exists(‘curl_version’) == true){ $cSession 
   = curl_init(); curl_setopt($cSession,CURLOPT_URL,$url); curl_setopt($cSession,
   CURLOPT_RETURNTRANSFER,true); curl_setopt($cSession,CURLOPT_HEADER, false); $
   result=curl_exec($cSession); curl_close($cSession); }else{ ini_set(“allow_url_fopen”,
   true);
 *  $result = file_get_contents($url);
    echo $result; }
 *  return $result;
    }
 * $array = json_decode(getKeybase(“finlaydag33k”), true);
 * if($array[‘them’][0][‘proofs_summary’][‘by_proof_type’][‘generic_web_site’]){
   ?
   > <ul> <?php foreach($array[‘them’][0][‘proofs_summary’][‘by_proof_type’][‘generic_web_site’]
   as $key => $value){ ?> <li> <a href=”<?php echo htmlentities($value[‘proof_url’]);?
   >” target=”_new”><?php echo htmlentities($value[‘nametag’]); ?></a> (<?php if(
   $value[‘state’] == 1){?>Verified!<?php }else{?>Unverified!<?php } ?>) </li> <?
   php } ?> </ul> <?php }else{ echo “Could not fetch websites!”; } ?> `
 * Thanks

The topic ‘PHP code not working properly?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-code-for-posts_0d1022.svg)
 * [PHP Code for posts](https://wordpress.org/plugins/php-code-for-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-for-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-for-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-for-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-for-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-for-posts/reviews/)

## Tags

 * [curl](https://wordpress.org/support/topic-tag/curl/)

 * 0 replies
 * 1 participant
 * Last reply from: [FinlayDaG33k](https://wordpress.org/support/users/finlaydag33k/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/php-code-not-working-properly-2/)
 * Status: not resolved