Tema: getmxrr() ,
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/10/2003, 21:23
Cluster
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
Pues exactamente la misma función no .. pero si que hay equivalentes. Fijate en los comentarios de los usuarios de php.net sobre esa función:

http://www.php.net/getmxrr

Cita:
geoffbrisbine A T y a h o o DOT c o m
24-Sep-2002 09:39
I was pretty disappointed that the Win32 build of PHP doesn't incorporate getmxrr so, since I'm a naive newbie, I decided to hack together my own (and I stress hack). This has been tested on Win 2000 and Win XP. There's no reason this shouldn't work on Win NT but it will not work on Win 9x (you need the nslookup command). It will finish with the array $mx that will be a multidimensional array with the MX preference, host name and ip address. You can do a print_r ( $mx ) to see what it looks like.

Código PHP:
<?php
$command 
"nslookup -type=mx yahoo.com";
exec $command$result );
    
$i 0;
while ( list ( 
$key$value ) = each $result ) ) {
    if ( 
strstr $value"mail exchanger" ) ) { $nslookup[$i] = $value$i++; }
}
    
while ( list ( 
$key$value ) = each $nslookup ) ) {
    
$temp explode " "$value );
    
$mx[$key][0] = $temp[3];
    
$mx[$key][1] = $temp[7];
    
$mx[$key][2] = gethostbyname $temp[7] );
}

    
array_multisort $mx );
?>
Fijate que usa una llamada al S.O. y ejecuta el comando (en la Shell .. línea de comandos DOS):

nslookup

Ahí mismo comenta que sólo funcionaría bajo W200 o XP .. no en W9X pues no dispone de ese comando ...

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.