Skip to content
Advertisement

Tag: multidimensional-array

Processing multi-dimensional $_FILES array

I have the following $_FILES array past through for processing from a support form My main problem is understanding the logic required in order to process the array, check each file is valid (which I already have a list of valid extensions) then rename and store the file appropriately. The solutions on Google and SO are both rather complex for

Search Array : array_filter vs loop

I am really new in PHP and need a suggestion about array search. If I want to search for an element inside a multidimensional array, I can either use array_filter or I can loop through the array and see if an element matching my criteria is present. I see both suggestion at many places. Which is faster? Below is a

PHP – lookup array contents with dot syntax [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question Does anybody see anything wrong with the following function? (Edit: no, I don’t think anything is wrong, I am just double-checking since this will be

PHP’s array_merge_recursive behaviour on integer keys

Is there an approach for recursively merging arrays, in the same way as PHP’s array_merge_recursive() function does, except that integer keys are treated the same as string keys? (It’s important for the process that the keys remain parse-able as integers.) For example: Will merge the on the “a” key and output, as expected, the following: However, when using integers for

Advertisement