13c02-1.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 22 行

PHP
22
字号
<?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 + =
减小字号Ctrl + -
显示快捷键?