duanrongpai9556 2012-05-09 20:35
浏览 8
已采纳

如何从这个数组中获取数据? 单点登录

I have implemented a Single Sign on function using Janrain. It outputs this data (amongst other data). Is it possible to break this down and extract only the displayName for example so that I may place it in a variable?

auth_info:
array(3) {
  ["stat"]=>
  string(2) "ok"
  ["profile"]=>
  array(10) {
    ["providerName"]=>
    string(8) "Facebook"
    ["identifier"]=>
    string(48) "removed"
    ["preferredUsername"]=>
    string(10) "OllieJones"
    ["displayName"]=>
    string(11) "Ollie Jones"
    ["name"]=>
    array(3) {
  ["formatted"]=>
  string(11) "Ollie Jones"
  ["givenName"]=>
  string(5) "Ollie"
  ["familyName"]=>
  string(5) "Jones"
}

Here is the script that creates it and where I would like to define the variable https://github.com/janrain/Janrain-Sample-Code/blob/master/php/rpx-token-url.php

Many Thanks

  • 写回答

1条回答 默认 最新

  • doutangxi2144 2012-05-09 20:41
    关注

    Try $auth_info['profile']['displayName']

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退