I have a quickie :)
I have a null array consisting of string values:
array 0 => string 'Message 1' (length=9) 1 => string '%company' (length=8) 2 => string 'Message 2' (length=9) 3 => string '%name' (length=5)
I need to select all values ​​starting with % and ideally put them in another array.
array 0 => string 'Message 1' (length=9) 1 => string 'Message 2' (length=9) array 0 => string '%company' (length=8) 1 => string '%name' (length=5)
Thanks!
For anyone interested, the first array is the result of a validation function, and since I hate it when the validator returns information about the required inputs in a million lines (for example: it requires <br><br> , which is required ...), instead of displaying real messages, I display the names of the necessary and unfilled entries that should be placed in one nice message "Fields are, these are even mandatory" :)
Miniedit: we will be grateful even for links to questions with answers to stackoverflow :)
source share