Homec4science

Provide array_interleave()

Authored by epriestley <git@epriestley.com> on Jan 29 2013, 03:41.

Description

Provide array_interleave()

Summary:
This tackles the specific case of:

phutil_render_tag(
  'div',
  array(),
  implode(' &middot; ', $list_of_stuff));

...replacing it with:

phutil_tag(
  'div',
  array(),
  array_interleave(" \xC2\xB7 ", $list_of_stuff));

While we could continue using implode(), that means we can never get rid of the __toString() call.

Test Plan: unit tests

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4682

Details

Committed
epriestley <git@epriestley.com>Jan 29 2013, 03:41
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU5bde9c036411: Add function calling nl2br() and phutil_escape_html()
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUf5a962181a42: Provide array_interleave() (authored by epriestley <git@epriestley.com>).Jan 29 2013, 03:41