What’s the difference between unset() and unlink()? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

What’s the difference between unset() and unlink()?

can you give me a answer

27th Jan 2018, 12:19 PM
John Lloyd V. Dela Vega
John Lloyd V. Dela Vega - avatar
2 Answers
+ 7
thank you
27th Jan 2018, 12:46 PM
John Lloyd V. Dela Vega
John Lloyd V. Dela Vega - avatar
+ 2
unlink() is a function for file system handling, unlink() is used to delete files. Suppose you have uploaded a file and wants to delete this file through the coding then unlink() function is used to delete the file. unset() is a function for variable management. unset() is used to null out the value of a given variable. or Unset () is used to destroy a variable in PHP. In can be used to remove a single variable, multiple variables, or an element from an array. in short: unlink is used to remove/delete files. Whereas unset is used to unset a variable used in programming. unset() destroys the specified variables.
27th Jan 2018, 12:42 PM
Sunil Thakali
Sunil Thakali - avatar