php如何将字符串转换为对象或数组

时间:2014-07-10 23:56:00

标签: php

目前,我正在阅读一个文件,其内容采用以下格式:

Array
(
    [0] => Array
        (
            [a] =>
            [b] =>
            [c] => happy
            [d] => mother
            [f] => undergraduate
            [e] => nice
            [g] => hello world
        )
    [1] => Array
        (
            [a] =>
            [b] =>
            [c] => haha
            [d] => father
            [f] => graduate
            [e] => ncoll
            [g] => world
        )
)

现在,我使用file_get_contents函数将文件作为字符串读取,然后我不知道如何将文件作为数组读取。

我正在尝试获取密钥及其相应的值。

0 个答案:

没有答案