Last active
March 22, 2017 07:54
-
-
Save violetyk/26df9150a8c82511d2d3bf6445865740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array('name' => array( 'error1', 'error2')); | |
$b = array('email' => array('error3', 'error4')); | |
$errors = array_merge($a, $b); | |
$result = array_reduce($errors, function($c, $v) { return array_merge($c, $v); }, array()); | |
print_r($errors); | |
print_r($result); | |
print_r(implode('\n', $result)); |
Author
violetyk
commented
Mar 22, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment