note 59736 deleted from function.ldap-get-attributes by nlopess
| From: | nlopess@php.net | Date: | Wed, 14 Dec 2005 19:27:26 +0000 |
| Subject: | note 59736 deleted from function.ldap-get-attributes by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100155@lists.php.net to get a copy of this message | ||
Note Submitter: cyril at feraudet dot com
----
A small function with a big regex to parse ldap uri (RFC 2255)
<?php
function ldap_get_uri_info($uri) {
$ldap_uri_regex = "a very big regex available at http://feraudet.com";
if(ereg($ldap_uri_regex,$uri,$reg))
return array('ssl'=>$reg[1]=='s'?1:0,
'port'=>$reg[17], 'host'=>$reg[3], 'base'=>$reg[18],
'attributes'=>$reg[137], 'filter'=>$reg[149],
'scope'=>$reg[147]);
return false;
}
?>
The regex is not here cause php.net doesn't accept too long line ...
Regex at http://feraudet.com/
Cyril Feraudet