📄 13c02-1.php
字号:
<?php// Ok, begin by connecting to the ldap server.if (!($lc = ldap_connect('ldap.example.com'))) { die("ERROR: Can't connect to the LDAP server\n");}// Now, do an anonymous bind (read only access)ldap_bind($lc);// Now, we are going to search for anyone in the IT department// with a username starting with 'e'$res = ldap_search($lc, 'o=Information Technology, c=US', 'un=e*');// Now, let's read all results from our search:$data = ldap_get_entries($lc, $res);// Loop over them all, echoing the data out:for ($i=0; $i < $data['count']; $i++) { echo "Full entry (distinguished name - dn): {$data[$i]['dn']}<br />\n"; echo "Username: {$data[$i]['un'][0]}<br />\n";}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -