Advertisement
max_tre

iptoflag

Feb 21st, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. function get_string_between($string, $start, $end){
  4. $string = " ".$string;
  5. $ini = strpos($string,$start);
  6. if ($ini == 0) return "";
  7. $ini += strlen($start);
  8. $len = strpos($string,$end,$ini) - $ini;
  9. return substr($string,$ini,$len);
  10. }
  11.  
  12. $ip='32.74.212.166'; //insert player's ip here
  13. $flag='http://www.turbosliders.com/sites/all/themes/turbosliders/images/country/'.get_string_between(file_get_contents('http://www.geoplugin.net/xml.gp?ip='.$ip),'<geoplugin_countryCode>','</geoplugin_countryCode>').'.GIF';
  14. echo '<img src='.$flag.'>';
  15.  
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement