$destination_path = getcwd().DIRECTORY_SEPARATOR;
I am using the above to get the full path till the folder containing the above script. I want to eliminate starting portion of the string to get only the current folder name.
Eg: if $destination_path = E:/www/stack; I want to eliminate E:/www/ from it to get only stack as result.
Try
getcwdwill give thecurrent working directory, which would be the directory of the php file called for execution or thecurrent working directoryin case you are executing from the command line.If you want to get the directory which contains the file with this specific code, use