Why use DS instead of /

I’ve seen that there is a constand named DS, a separator between folders, a replacement for / (slash). What is the benefit of using DS instead of slash?

$str = 'myfile/' . $var . '/another-slug/more/' . $var2. '/the-end';
$str = 'myfile' . DS . $var . DS . 'another-slug' . DS . 'more' . DS . $var2. DS . 'the-end';

I use it throughout Kirby to avoid issues on Windows.

1 Like