method clean documentation in bbn\File\Dir
Replaces backslash with slash and deletes whitespace from the beginning and the end of a directory's path.
Example
\bbn\X::dump(\bbn\File\Dir::clean("\home\data\test"));
// (string) "/home/data/test"
function(string $dir)
{
$new = trim(str_replace('\\', '/', $dir));
if ( substr($new, -1) === '/' ){
$new = substr($new, 0, -1);
}
return $new;
}
Replaces backslash with slash and deletes whitespace from the beginning and the end of a directory's path. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions