So I have the following path: /my_user/path/to/dir, and when I pass it to file_exists(), it works fine.
/my_user/path/to/dir
file_exists()
However, when I change it to
$home_dir = exec( 'echo ~' ) ;