代碼如下:
<?php if($_SERVER['HTTP_CLIENT_IP']){ $onlineip=$_SERVER['HTTP_CLIENT_IP']; }elseif($_SERVER['HTTP_X_FORWARDED_FOR']){ $onlineip=$_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $onlineip=$_SERVER['REMOTE_ADDR']; } /* 何問起 hovertree.com */ echo $onlineip; ?>
推薦:http://www.cnblogs.com/roucheng/p/phpexcel.html