Skip to content
Corey Avis edited this page Sep 23, 2026 · 2 revisions

getIP

Retrieves the local network IP address for the primary network interface.

Usage

getIP(bool $long = false): string|integer

Parameters

long (bool) : If set to true, IPv4 addresses will be returned as a long integer. ^(optional)^

Return Value

(string|integer) : Returns IP address.

Examples

$cphp->getIP() = 127.0.0.1
$cphp->getIP(true) = 2130706433

Debug Errors

  • No debug errors.

Related Methods

reservedIP | validIP


Home | CoreyPHP | IP Operations

Clone this wiki locally