/** - * Miscellaneous utility methods.
- */
- final class Utils {
private function __construct() { -
- }
/** - * Get IP address
- * @return string IP address string
- */
- public static function getIpAddress() {
- return $_SERVER["REMOTE_ADDR"];
- }
- }
- ?>
2、调用
- $last_login_ip = Utils::getIpAddress();
- ?>
|