How can the choice between 32-bit and 64-bit for PHP be determined using the 'file' command?

To determine whether PHP is running as 32-bit or 64-bit, the 'file' command can be used on the PHP binary file. By running 'file /path/to/php' in the terminal, the architecture of the PHP binary will be displayed. If it shows '32-bit' or '64-bit', then the architecture of PHP is determined.

echo shell_exec('file /path/to/php');