Category: How To?

get file extension in php

How to get file extension in PHP

Getting an extension of a file from PHP string to validate a file for upload is an important task. For example, if you have a file upload which allows you to upload only images then you need to validate the...

Array Filter in PHP

How to filter array by value using array_filter() in PHP

array_filter() is the function which iterates over every value in array and pass them to the callback function. If callback function returns true, then the current value is returned to the output otherwise not. Array keys are always preserved. You...