Foreach add to array
Posted: Thu Mar 14, 2013 7:12 pm
I have a function that grabs data from a url and parses it into an array. So I have one array inside another array so:
[syntax=text]ARRAY {
- First Post
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com
- Second Post
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com }[/syntax]
and I was wondering how I add an entry to each of the arrays in a foreach loop so I could get
[syntax=text]ARRAY {
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com
-- Shortcode
--- abc123
- Second Post
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com
-- Shortcode
--- abc123 }[/syntax]
Thanks!
[syntax=text]ARRAY {
- First Post
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com
- Second Post
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com }[/syntax]
and I was wondering how I add an entry to each of the arrays in a foreach loop so I could get
[syntax=text]ARRAY {
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com
-- Shortcode
--- abc123
- Second Post
-- Author
--- Fred
-- Date
--- 13/3/1998
-- URL
--- example.com
-- Shortcode
--- abc123 }[/syntax]
Thanks!