Help with PHP deprecated create_function()

I had some PHP scripts written for my website some years ago that now contain deprecated code and I’m longer getting a response from the developer. I’m wondering if anyone here can help? Complete function that contains deprecated “create_function”:

function codeFileToArray() {
	array_walk($codes,create_function('&$val', '$val = trim($val);'));
	return $codes;

Searching the net I see I need to use function() instead of create_function(), but as I’m not familiar with PHP syntax, I’m not sure how to modify this line.

Thanks in advance.


Thanks Jim.

In case anyone finds this in the future the following fixed the issue:

array_walk($codes,function(&$val){$val = trim($val);});