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() {
	$codes = file(CODESEARCH_CONFIG_CODEFILE,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
	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.

see: https://www.php.net/manual/en/function.create-function.php

Thanks Jim.

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

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