note 119994 added to function.getmxrr
| From: | Anonymous | Date: | Thu, 06 Oct 2016 12:30:19 +0000 |
| Subject: | note 119994 added to function.getmxrr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206783@lists.php.net to get a copy of this message | ||
One small polyfill for the getmxrr function(even when it's missing from linux system)
function getmxrr($hostname, &$mxhosts, array &$mxweight=null)
{
$mxhosts = array();
exec('nslookup -type=mx '.$hostname, $result_arr);
foreach($result_arr as $line)
{
if (preg_match("/.*mail exchanger = (.*)/", $line, $matches))
{
$s_xo=explode(' ', $matches[1]);
$mxhosts[] = $s_xo[1];
$mxweight[] = $s_xo[0];
}
}
return( count($mxhosts) > 0 );
}
----
Server IP: 72.52.91.14
Probable Submitter: 178.139.160.29
----
Manual Page -- http://php.net/manual/en/function.getmxrr.php
Edit -- https://master.php.net/note/edit/119994
Del: integrated -- https://master.php.net/note/delete/119994/integrated
Del: useless -- https://master.php.net/note/delete/119994/useless
Del: bad code -- https://master.php.net/note/delete/119994/bad+code
Del: spam -- https://master.php.net/note/delete/119994/spam
Del: non-english -- https://master.php.net/note/delete/119994/non-english
Del: in docs -- https://master.php.net/note/delete/119994/in+docs
Del: other reasons-- https://master.php.net/note/delete/119994
Reject -- https://master.php.net/note/reject/119994
Search -- https://master.php.net/manage/user-notes.php