I have an assoc array that I want to rewrite into a much simpler assoc array but I don't know how to start it.
This is the array that I have:
Array
(
[username] => Array
(
[notEmpty] => Please fill this field
[alphaNumeric] => Username can only be letters and numbers.
[between] => Username must be from 3 to 15 characters only.
)
[first_name] => Array
(
[_empty] => This field cannot be left empty
)
[last_name] => Array
(
[_empty] => This field cannot be left empty
)
)
And this is the array that I want to produce:
Array
(
"username" => "Please fill this field",
"first_name" => "This field cannot be left empty",
"last_name" => "This field cannot be left empty"
)
Sorry if this may be a simple question but I really don't know where to start and especially the logic when it comes to getting only the first value of the array and not include the others.
Thank you so much, and I really appreciate it!