Tenho uma linha como esta:
? (192.168.1.191) at 00:4F:62:10:D6:5B [ether] on eth1 ? (192.168.1.194) at 00:1D:7D:F4:A5:B8 [ether] on eth1 ? (192.168.1.157) at 00:1D:7D:FE:B9:4C [ether] on eth1 ? (192.168.1.195)
Preciso pegar apenas os ips que estao entre parenteses. É possivel?

Extrair Ips De Variável
Started By Dantes, 16/06/2008, 11:19
3 replies to this topic
#1
Posted 16/06/2008, 11:19
#2
Posted 16/06/2008, 12:27
<?php preg_match_all("/\(\d+\.\d+\.\d+\.\d+\)/", $variavel, $matches); echo "<pre>"; print_r($matches[0]); echo "</pre>"; ?>
Tente ai.

#3
Posted 16/06/2008, 12:45
muito bom, valeu

#4
Posted 16/06/2008, 14:15
O Aurélio tem uma ER muito boa pra IP, dê uma olhada: http://aurelio.net/doc/er-rdl/ip.html (a principal fica no fim da página) 
[]s
Até mais

[]s

1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)