首页 >后端开发 >php教程 >如何快捷的取出数组里的值?

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

WBOY
WBOY原创
2016-06-06 20:35:001519浏览

类似这样:

<code>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
                                                        )

                                                )

                                        )

                                )

                        )

                )

        )

)
</code>

回复内容:

类似这样:

<code>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
                                              </code>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn