Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created April 6, 2020 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shameemreza/2decb39d24a8e45470b0db8c5488959a to your computer and use it in GitHub Desktop.
Save shameemreza/2decb39d24a8e45470b0db8c5488959a to your computer and use it in GitHub Desktop.
arr::divide()
// We import the support for this Helper
use Illuminate\Support\Arr;
// We use the method Arr::divide()
[$keys, $values] = Arr::divide(['name' => 'Shameem Reza', 'price' => '3.40']);
// We obtain the keys and values separately
$keys: ['name', 'price']
$values: ['Shameem Reza', '3.40']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment