How can a byte sequence with unknown coding be made available as input for PHP?
问题 I have a file with an unknown encoding. I can read this file as a string with file_get_contents(). I would like to export this string so that it can be made available as PHP code. The string can be represented in hexadecimal using bin2hex (). However, this cannot be used in PHP without special code. So my question: How can a byte sequence from a file with unknown encoding be output with PHP in such a way that the output can be used as reproducible PHP code? 回答1: var_export is probably the