Hey.
The
bin2hex function simply takes a string, converts it to it's hexadecimal form, and then returns the new HEX string. (The input string is not altered, unless you overwrite it with the return value, if that is what you are asking.)
To convert an entire file into it's HEX equivalent, you need to load the file into PHP, run the binary string through the function, and then save it or output it or do whatever you want done with it.
Note that a file encoded in HEX is 2x larger than it's binary form, so you may find there are better ways to do whatever it is you want to do with it. (What
are you planing to do with it?)