My string looks like:
$fullPath = $dirName . \"/\" . $file;
If I replace / with \\, it gives error:
Expecting identifier
You need to escape the slash: $fullPath = $dirName . "\\" . $file;
$fullPath = $dirName . "\\" . $file;