Jump to content

Why this php example used basename function?


Uday4all

Recommended Posts

Source page: http://www.w3schools.com/php/php_file_upload.asp

In the file upload script,the example contains the following line of code

$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);

 

 

but why it should not be like?

$target_file = $target_dir . $_FILES["fileToUpload"]["name"];

 

i mean without using basename function :)

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...