function openid_extract_ax_values

cis7 openid_extract_ax_values($values, $uris)
cle7 openid_extract_ax_values($values, $uris)
elmsmedia7 openid_extract_ax_values($values, $uris)
icor7 openid_extract_ax_values($values, $uris)
meedjum_blog7 openid_extract_ax_values($values, $uris)
mooc7 openid_extract_ax_values($values, $uris)

Extracts values from an OpenID AX Response.

The values can be returned in two forms:

  • only<alias> (for single-valued answers)
  • both<alias> and<alias>.<count> (for both single and multiple-valued answers)


$values: An array as returned by openid_extract_namespace(..., OPENID_NS_AX).

$uris: An array of identifier URIs.

Return value

An array of values.

See also

2 calls to openid_extract_ax_values()
openid_form_user_register_form_alter in modules/openid/openid.module
Implements hook_form_FORM_ID_alter().
_openid_invalid_openid_transition in modules/openid/
Provides transition for accounts with possibly invalid OpenID identifiers in authmap.


modules/openid/, line 692
OpenID utility functions.


function openid_extract_ax_values($values, $uris) {
  $output = array();
  foreach ($values as $key => $value) {
    if (in_array($value, $uris) && preg_match('/^type\.([^.]+)$/', $key, $matches)) {
      $alias = $matches[1];
      if (isset($values['count.' . $alias])) {
        for ($i = 1; $i <= $values['count.' . $alias]; $i++) {
          $output[] = $values['value.' . $alias . '.' . $i];
      elseif (isset($values['value.' . $alias])) {
        $output[] = $values['value.' . $alias];
  return $output;