#!/usr/bin/php /'; foreach ( $entity_files as $file ) { $contents = file_get_contents ( $entity_dir . $file ); $matches = array (); preg_match_all ( $regexp, $contents, $matches, PREG_SET_ORDER ); foreach ( $matches as $match ) { $entity_table [$match [1]] = unichr ( $match [2] ); } } $output = serialize ( $entity_table ); $fh = fopen ( $output_file, 'w' ); fwrite ( $fh, $output ); fclose ( $fh ); echo "Completed successfully."; // vim: et sw=4 sts=4