- This topic is empty.
-
AuthorPosts
-
July 1, 2013 at 5:02 pm #46014
chrisburton
ParticipantMy array:
array (size=15)
0 =>
array (size=5)
‘title’ => string ‘SCOTUS: No right to remain silence unless you speak up’ (length=54)
‘link’ => string ‘http://www.readability.com/read?url=http://www.salon.com/2013/06/30/scotus_no_right_to_remain_silence_unless_you_speak_up_partner/’ (length=130)
‘description’ => string ‘This article originally appeared on International Business Times. If you want to invoke your constitutional right to remain silent, you’d better not be silent. That’s the circular logic of a recent…’ (length=209)
‘pubDate’ => string ‘Sun, 30 Jun 2013 08:14:59 -0400’ (length=31)
‘guid’ => string ‘http://www.readability.com/read?url=http://www.salon.com/2013/06/30/scotus_no_right_to_remain_silence_unless_you_speak_up_partner/’ (length=130)
1 =>
array (size=5)
‘title’ => string ‘Best Dorm Room Ever! A Peek Inside San Francisco’s New Tiny Apartments’ (length=72)
‘link’ => string ‘http://www.readability.com/read?url=http://www.architizer.com/en_us/blog/dyn/91947/best-dorm-rooms-ever-panoramic-interests-smartspace-soma/#.Uc-kbGS9Kc0’ (length=153)
‘description’ => string ‘The Berkeley, California-based developer Patrick Kennedy does not like to hear his apartments compared to dorm rooms. “That’s a bad word in our office,” he told Architizer.…’ (length=201)
‘pubDate’ => string ‘Sat, 29 Jun 2013 23:24:36 -0400’ (length=31)
‘guid’ => string ‘http://www.readability.com/read?url=http://www.architizer.com/en_us/blog/dyn/91947/best-dorm-rooms-ever-panoramic-interests-smartspace-soma/#.Uc-kbGS9Kc0’ (length=153)
[etc]Desired Result:
array (size=15)
0 =>
array (size=5)
‘title’ => string ‘SCOTUS: No right to remain silence unless you speak up’ (length=54)
‘link’ => string ‘http://www.readability.com/read?url=http://www.salon.com/2013/06/30/scotus_no_right_to_remain_silence_unless_you_speak_up_partner/’ (length=130)
1 =>
array (size=5)
‘title’ => string ‘Best Dorm Room Ever! A Peek Inside San Francisco’s New Tiny Apartments’ (length=72)
‘link’ => string ‘http://www.readability.com/read?url=http://www.architizer.com/en_us/blog/dyn/91947/best-dorm-rooms-ever-panoramic-interests-smartspace-soma/#.Uc-kbGS9Kc0’ (length=153)
[etc]How can I remove `description`, `pubDate` and `guid` from the array so it just leaves `title` and `link`?
July 1, 2013 at 5:12 pm #141186TheDoc
MemberInstead, wouldn’t you just change the code that iterates through the array to ignore the items that you don’t want?
July 1, 2013 at 5:28 pm #141191Kitty Giraudel
Participant> Instead, wouldn’t you just change the code that iterates through the array to ignore the items that you don’t want?
I would do that.
July 1, 2013 at 5:30 pm #141192chrisburton
Participant@TheDoc You mean do something like this?:
$items = $data; // this is what outputs the 1st example
$title = $items; // grabs the title
$url = $items; // grabs the linkJuly 1, 2013 at 5:36 pm #141195__
ParticipantIgnoring the items you don’t want is usually best.
_– snip —
overkill answer._July 1, 2013 at 5:46 pm #141200chrisburton
Participant -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.