извлекать значения из массива (php или jquery)

У меня есть такой массив:

Array
(
[username] => myusername
[created_at] => 2013-01-01 15:30:27
[public_id] => aaabbbccc112233
[reputation] => 16
[hourly_quota] => 256
[backlog] => 32
[stats] => Array
(
[today] => Array
(
[sent] => 43
[hard_bounces] => 556
[soft_bounces] => 64
[rejects] => 36
[complaints] => 123
[unsubs] =>45
[opens] => 36
[unique_opens] => 45
[clicks] =>69
[unique_clicks] => 123
)

[last_7_days] => Array
(
[sent] => 25
[hard_bounces] =>125
[soft_bounces] => 29
[rejects] => 42
[complaints] => 42
[unsubs] => 42
[opens] => 42
[unique_opens] => 42
[clicks] => 42
[unique_clicks] => 42
)

[last_30_days] => Array
(
[sent] => 42
[hard_bounces] => 42
[soft_bounces] => 42
[rejects] => 42
[complaints] => 42
[unsubs] => 42
[opens] => 42
[unique_opens] => 42
[clicks] => 42
[unique_clicks] => 42
)

[last_60_days] => Array
(
[sent] => 42
[hard_bounces] => 42
[soft_bounces] => 42
[rejects] => 42
[complaints] => 42
[unsubs] => 42
[opens] => 42
[unique_opens] => 42
[clicks] => 42
[unique_clicks] => 42
)

[last_90_days] => Array
(
[sent] => 42
[hard_bounces] => 42
[soft_bounces] => 42
[rejects] => 42
[complaints] => 42
[unsubs] => 42
[opens] => 42
[unique_opens] => 42
[clicks] => 42
[unique_clicks] => 42
)

[all_time] => Array
(
[sent] => 42
[hard_bounces] => 42
[soft_bounces] => 42
[rejects] => 42
[complaints] => 42
[unsubs] => 42
[opens] => 42
[unique_opens] => 42
[clicks] => 42
[unique_clicks] => 42
)

)

)

Как я могу извлечь каждое значение в одну строку?

Пример :

  • $today-sent="43"
  • $7days-sent="25"
  • $today-hard_bounces="64"

1

Решение

$todaySent = $array['stats']['today']['sent'];
$lastSeven = $array['stats']['last_7_days']['sent'];
$todayBounce = $array['stats']['today']['hard_bounces'];

Вы можете делать все что угодно с переменными, хранящими значения.

3

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]