0
Array ( 
    [meta] => Array ( 
    [status] => 200 [msg] => OK ) 
    [response] => Array ( 
        [user] => Array ( 
            [name] => paulkin360 
            [likes] => 0 
            [following] => 2 
            [default_post_format] => html 
            [blogs] => Array ( 
                [0] => Array ( 
                    [name] => paulkin360 
                    [url] => http://paulkin360.tumblr.com/ [
                    [followers] => 0 
                    [primary] => 1 
                    [title] => Untitled 
                    [description] => 
                    [admin] => 1 
                    [updated] => 1379175176 
                    [posts] => 2 
                    [messages] => 0 
                    [queue] => 0 
                    [drafts] => 0 
                    [share_likes] => 1 
                    [ask] => 
                    [tweet] => auto 
                    [facebook] => auto 
                    [facebook_opengraph_enabled] => Y [type] => public 
                ) 
            ) 
        ) 
    ) 
)

到目前为止,这就是我所拥有的,但我想在 html 中重新组织它

4

1 回答 1

1

这是一个帮助您入门的示例,您需要自己构建实际的 HTML。

<?php
$user = $your_array['response']['user'];
?>

<div>Name: <?php echo $user['name']; ?></div>
<div>Likes: <?php echo $user['likes']; ?></div>
<div>Following: <?php echo $user['following']; ?></div>

<?php foreach($user['blogs'] as $blog): ?>
<div class="blog">
    <div>Name: <?php echo $blog['name']; ?></div>
    <div>URL: <?php echo $blog['url']; ?></div>
    <div>Followers: <?php echo $blog['followers']; ?></div>
    <div>Title: <?php echo $blog['title']; ?></div>
</div>
<?php endforeach; ?>
于 2013-09-17T10:56:59.053 回答