2024-07-14 08:37:54

Weirdly I could not find a way to replicate shell-expansion of file paths (like “~/test1”) in PHP or Laravel.

Is this because it wouldn’t work cross-platform?

Ended up doing this, but it doesn’t seem ideal.

exec(“echo $filepath”, $output);
$fullpath = $output[0];

Context: I’m passing a CLI option like “path=~/test1”