我有返回数组的页面 getorgname.php 那么如何使用 $.ajax 方法在我的 jquery 页面中获取数组?
$ds = my_ldap_connect(CHI_LDAP_LOCATION, CHI_LDAP_PORT, CHI_LDAP_USE_TLS);
$groups = get_all_groups($ds, CHI_LDAP_BASE_DN, CHI_LDAP_BIND_DIRECTORY, CHI_LDAP_BIND_PASSWORD);
$sr = @ldap_search($ds, "ou=people,".CHI_LDAP_BASE_DN, "(uid=*)");
$nt = ldap_get_entries( $ds, $sr );
//echo "<pre>";
//print_r($nt);
//echo "</pre>";
foreach( $nt as $each )
{
if( is_array( $each ) )
{
$json[] = trim('"'.$each['o'][0].'"');
}
}
返回 $json;