Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "1": {
- "name": "test",
- "followup": {
- "1": {
- "id": "98",
- "followup": {
- "1": {
- "id": "93",
- "followup": {
- "1": {
- "id": "174"
- },
- }
- }
- }
- }
- }
- }
- }
- $ids = array();
- $data = json_decode($str, true);
- array_walk_recursive($data, function($v, $k) use (&$ids) {
- if ($k === 'id') {
- $ids[] = $v;
- }
- });
- var_dump($ids);
Add Comment
Please, Sign In to add comment