Login +

Documentation

SLS_String::isIp

Since SillySmart 1.0

Description

Check if the given string is a IPSince sls 1.0.7, added ipv6 support
static bool isIp ( string $string, [ string $type ] );

Parameters

  • string $string
    the string to test
  • string $type
    the type of ip v4|v6|both (default: both)

Return

bool
true if the string match with an ip, else false

Exemples

  •  var_dump(SLS_String::isIp("192.168.0.1"));
     // will produce : true
  •  var_dump(SLS_String::isIp("192.168.0"));
     // will produce : false

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.