Advertisement
LenweSaralonde

armory_test_utf8.php

Dec 17th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <?php
  2.     // This file is UTF-8 encoded
  3.  
  4.     $char  = 'Dæàüiãøïôâßû';
  5.     $realm = 'Hyjal';
  6.     $area  = 'eu';
  7.  
  8.     $profile = @json_decode(@file_get_contents('http://' . $area . '.battle.net/api/wow/character/' . urlencode($realm) . '/' . urlencode($char) . '?fields=guild,pvp'));
  9.  
  10. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  11. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
  12.     <head>
  13.         <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  14.         <title><?php echo @$profile->name ?></title>
  15.     </head>
  16.     <body>
  17.         <?php
  18.             if (empty($profile))
  19.                 echo "Character $char not found";
  20.             else
  21.             {
  22.                 echo '<img src="http://' . $area . '.battle.net/static-render/' . $area . '/' . $profile->thumbnail . '" />';
  23.  
  24.                 echo "<h1>$profile->name</h1>";
  25.  
  26.                 if (!empty($profile->guild))
  27.                     echo "<h2>&lt;" . $profile->guild->name . "&gt;</h2>";
  28.  
  29.                 echo '<pre>' . print_r($profile, true) . '</pre>';
  30.             }
  31.         ?>
  32.     </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement