<?php
//в следующей строке syntax error, unexpected T_FUNCTION, expecting ')'
$filesContentArray = array_map(function($filename) {
return [
'filename' => $filename,
'content' => base64_encode(file_get_contents($filename))
]
}, glob('/fonts/*.*'));
file_put_contents('1.json', json_encode($filesContentArray));
?>