如何快捷的取出数组里的值?

发布于 2022-09-01 07:02:10 字数 35742 浏览 18 评论 0

类似这样:

Array
(
    [tag] => PubmedArticle
    [value] => Array
        (
            [0] => Array
                (
                    [tag] => MedlineCitation
                    [value] => Array
                        (
                            [0] => Array
                                (
                                    [tag] => PMID
                                    [value] => 25864520
                                    [attributes] => Array
                                        (
                                            [Version] => 1
                                        )

                                )

                            [1] => Array
                                (
                                    [tag] => DateCreated
                                    [value] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [tag] => Year
                                                    [value] => 2015
                                                )

                                            [1] => Array
                                                (
                                                    [tag] => Month
                                                    [value] => 4
                                                )

                                            [2] => Array
                                                (
                                                    [tag] => Day
                                                    [value] => 13
                                                )

                                        )

                                )

                            [2] => Array
                                (
                                    [tag] => DateRevised
                                    [value] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [tag] => Year
                                                    [value] => 2015
                                                )

                                            [1] => Array
                                                (
                                                    [tag] => Month
                                                    [value] => 4
                                                )

                                            [2] => Array
                                                (
                                                    [tag] => Day
                                                    [value] => 14
                                                )

                                        )

                                )

                            [3] => Array
                                (
                                    [tag] => Article
                                    [value] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [tag] => Journal
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => ISSN
                                                                    [value] => 1364-548X
                                                                    [attributes] => Array
                                                                        (
                                                                            [IssnType] => Electronic
                                                                        )

                                                                )

                                                            [1] => Array
                                                                (
                                                                    [tag] => JournalIssue
                                                                    [value] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [tag] => PubDate
                                                                                    [value] => Array
                                                                                        (
                                                                                            [0] => Array
                                                                                                (
                                                                                                    [tag] => Year
                                                                                                    [value] => 2015
                                                                                                )

                                                                                            [1] => Array
                                                                                                (
                                                                                                    [tag] => Month
                                                                                                    [value] => Apr
                                                                                                )

                                                                                            [2] => Array
                                                                                                (
                                                                                                    [tag] => Day
                                                                                                    [value] => 13
                                                                                                )

                                                                                        )

                                                                                )

                                                                        )

                                                                    [attributes] => Array
                                                                        (
                                                                            [CitedMedium] => Internet
                                                                        )

                                                                )

                                                            [2] => Array
                                                                (
                                                                    [tag] => Title
                                                                    [value] => Chemical communications (Cambridge, England)
                                                                )

                                                            [3] => Array
                                                                (
                                                                    [tag] => ISOAbbreviation
                                                                    [value] => Chem. Commun. (Camb.)
                                                                )

                                                        )

                                                )

                                            [1] => Array
                                                (
                                                    [tag] => ArticleTitle
                                                    [value] => Anisotropic particles templated by Janus emulsion.
                                                )

                                            [2] => Array
                                                (
                                                    [tag] => Pagination
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => MedlinePgn
                                                                    [value] => 
                                                                )

                                                        )

                                                )

                                            [3] => Array
                                                (
                                                    [tag] => Abstract
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => AbstractText
                                                                    [value] => Anisotropic particles, with morphology from crescent to moon shape and size from micrometer to nanometer scale, are fabricated in batch scale with Janus emulsion as template. The strategy is also useful in the synthesis of Janus particles with chemically distinct hemispheres.
                                                                    [attributes] => Array
                                                                        (
                                                                            [NlmCategory] => UNASSIGNED
                                                                        )

                                                                )

                                                        )

                                                )

                                            [4] => Array
                                                (
                                                    [tag] => AuthorList
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => Author
                                                                    [value] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [tag] => LastName
                                                                                    [value] => Ge
                                                                                )

                                                                            [1] => Array
                                                                                (
                                                                                    [tag] => ForeName
                                                                                    [value] => Lingling
                                                                                )

                                                                            [2] => Array
                                                                                (
                                                                                    [tag] => Initials
                                                                                    [value] => L
                                                                                )

                                                                            [3] => Array
                                                                                (
                                                                                    [tag] => AffiliationInfo
                                                                                    [value] => Array
                                                                                        (
                                                                                            [0] => Array
                                                                                                (
                                                                                                    [tag] => Affiliation
                                                                                                    [value] => School of Chemistry and Chemical Engineering, Yangzhou University, Yangzhou, Jiangsu, China. llge@yzu.edu.cn guorong@yzu.edu.cn.
                                                                                                )

                                                                                        )

                                                                                )

                                                                        )

                                                                )

                                                            [1] => Array
                                                                (
                                                                    [tag] => Author
                                                                    [value] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [tag] => LastName
                                                                                    [value] => Lu
                                                                                )

                                                                            [1] => Array
                                                                                (
                                                                                    [tag] => ForeName
                                                                                    [value] => Shuhui
                                                                                )

                                                                            [2] => Array
                                                                                (
                                                                                    [tag] => Initials
                                                                                    [value] => S
                                                                                )

                                                                        )

                                                                )

                                                            [2] => Array
                                                                (
                                                                    [tag] => Author
                                                                    [value] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [tag] => LastName
                                                                                    [value] => Han
                                                                                )

                                                                            [1] => Array
                                                                                (
                                                                                    [tag] => ForeName
                                                                                    [value] => Jie
                                                                                )

                                                                            [2] => Array
                                                                                (
                                                                                    [tag] => Initials
                                                                                    [value] => J
                                                                                )

                                                                        )

                                                                )

                                                            [3] => Array
                                                                (
                                                                    [tag] => Author
                                                                    [value] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [tag] => LastName
                                                                                    [value] => Guo
                                                                                )

                                                                            [1] => Array
                                                                                (
                                                                                    [tag] => ForeName
                                                                                    [value] => Rong
                                                                                )

                                                                            [2] => Array
                                                                                (
                                                                                    [tag] => Initials
                                                                                    [value] => R
                                                                                )

                                                                        )

                                                                )

                                                        )

                                                )

                                            [5] => Array
                                                (
                                                    [tag] => Language
                                                    [value] => ENG
                                                )

                                            [6] => Array
                                                (
                                                    [tag] => PublicationTypeList
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => PublicationType
                                                                    [value] => JOURNAL ARTICLE
                                                                    [attributes] => Array
                                                                        (
                                                                            [UI] => 
                                                                        )

                                                                )

                                                        )

                                                )

                                            [7] => Array
                                                (
                                                    [tag] => ArticleDate
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => Year
                                                                    [value] => 2015
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [tag] => Month
                                                                    [value] => 4
                                                                )

                                                            [2] => Array
                                                                (
                                                                    [tag] => Day
                                                                    [value] => 13
                                                                )

                                                        )

                                                    [attributes] => Array
                                                        (
                                                            [DateType] => Electronic
                                                        )

                                                )

                                        )

                                    [attributes] => Array
                                        (
                                            [PubModel] => Print-Electronic
                                        )

                                )

                            [4] => Array
                                (
                                    [tag] => MedlineJournalInfo
                                    [value] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [tag] => MedlineTA
                                                    [value] => Chem Commun (Camb)
                                                )

                                            [1] => Array
                                                (
                                                    [tag] => NlmUniqueID
                                                    [value] => 9610838
                                                )

                                            [2] => Array
                                                (
                                                    [tag] => ISSNLinking
                                                    [value] => 1359-7345
                                                )

                                        )

                                )

                        )

                    [attributes] => Array
                        (
                            [Status] => Publisher
                            [Owner] => NLM
                        )

                )

            [1] => Array
                (
                    [tag] => PubmedData
                    [value] => Array
                        (
                            [0] => Array
                                (
                                    [tag] => History
                                    [value] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [tag] => PubMedPubDate
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => Year
                                                                    [value] => 2015
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [tag] => Month
                                                                    [value] => 4
                                                                )

                                                            [2] => Array
                                                                (
                                                                    [tag] => Day
                                                                    [value] => 14
                                                                )

                                                            [3] => Array
                                                                (
                                                                    [tag] => Hour
                                                                    [value] => 6
                                                                )

                                                            [4] => Array
                                                                (
                                                                    [tag] => Minute
                                                                    [value] => 0
                                                                )

                                                        )

                                                    [attributes] => Array
                                                        (
                                                            [PubStatus] => entrez
                                                        )

                                                )

                                            [1] => Array
                                                (
                                                    [tag] => PubMedPubDate
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => Year
                                                                    [value] => 2015
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [tag] => Month
                                                                    [value] => 4
                                                                )

                                                            [2] => Array
                                                                (
                                                                    [tag] => Day
                                                                    [value] => 14
                                                                )

                                                            [3] => Array
                                                                (
                                                                    [tag] => Hour
                                                                    [value] => 6
                                                                )

                                                            [4] => Array
                                                                (
                                                                    [tag] => Minute
                                                                    [value] => 0
                                                                )

                                                        )

                                                    [attributes] => Array
                                                        (
                                                            [PubStatus] => pubmed
                                                        )

                                                )

                                            [2] => Array
                                                (
                                                    [tag] => PubMedPubDate
                                                    [value] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [tag] => Year
                                                                    [value] => 2015
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [tag] => Month
                                                                    [value] => 4
                                                                )

                                                            [2] => Array
                                                                (
                                                                    [tag] => Day
                                                                    [value] => 14
                                                                )

                                                            [3] => Array
                                                                (
                                                                    [tag] => Hour
                                                                    [value] => 6
                                                                )

                                                            [4] => Array
                                                                (
                                                                    [tag] => Minute
                                                                    [value] => 0
                                                                )

                                                        )

                                                    [attributes] => Array
                                                        (
                                                            [PubStatus] => medline
                                                        )

                                                )

                                        )

                                )

                            [1] => Array
                                (
                                    [tag] => PublicationStatus
                                    [value] => aheadofprint
                                )

                            [2] => Array
                                (
                                    [tag] => ArticleIdList
                                    [value] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [tag] => ArticleId
                                                    [value] => 10.1039/c5cc00935a
                                                    [attributes] => Array
                                                        (
                                                            [IdType] => doi
                                                        )

                                                )

                                            [1] => Array
                                                (
                                                    [tag] => ArticleId
                                                    [value] => 25864520
                                                    [attributes] => Array
                                                        (
                                                            [IdType] => pubmed
                                                        )

                                                )

                                        )

                                )

                        )

                )

        )

)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

玩心态 2022-09-08 07:02:10

你这个题目问得太不清晰了。。。比如要取哪个数组里面的哪些值?

无畏 2022-09-08 07:02:10

这很明显是XML转来的吧

别转成数组先直接通过XML的方式来定位吧,XPath什么的还是很强大的

最偏执的依靠 2022-09-08 07:02:10

foreach

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文