Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 4
    In PHP 5.6 you can do array_push($data, ...array_values($row)) instead of $data = array_merge($data, array_values($row));. Much faster. Commented Feb 5, 2015 at 18:08
  • Why 5.6 ? Documentation doesn't say anything about 5.6, array_push() is available even in php 4. Commented Sep 20, 2015 at 20:02
  • 1
    @Piero it is PHP 5.6+ only code not because of the use of array_push(), but because @Mark is using argument unpacking. Notice the ...array_values() call there? Commented Sep 30, 2015 at 13:16
  • @mariano.iglesias array_values() is as well available in php 4. Not sure if that's what you mean by argument unpacking. Commented Sep 30, 2015 at 21:14
  • 5
    @Piero, Argument unpacking is a feature introduces in PHP 5.6. It's a way to provide multiple arguments as an array. Check here - php.net/manual/en/… Commented Aug 21, 2017 at 5:41