Get system ipv4 addresses as array in PHP

/** * Get system ipv4 addresses. * Works on Linux only. * @return [array] */ function getSystemIPs() { $ips = shell_exec( ‘hostname -I’ ); $ips = preg_split( ‘/\s+/’, $ips, -1, PREG_SPLIT_NO_EMPTY ); foreach ( $ips as $ip ) { if