unlink() Function:
- This function is used for file system handling.
- It deletes the file used in context. For example:
unlink('demo.txt');
The above line will delete the file unlink completely.
- It includes two parameters: filename which is required parameter and the other is context which is optional parameter.
- It will return true on success else returns false.
- Syntax: unlink(filename,context)
unset() Function:
- This function is used for variable management.
- It undefined a variable.
<?php
$demo='hello';
echo 'Before using unset() value of $demo is : '. $demo.'<br>';
unset($demo);
echo 'After using unset() the value of $demo is : '. $demo;
?>
The above code will give the following output:
Before using unset() value of $demo is : hello
After using unset() the value of $demo is :
- It includes one more parameter which are the variables names.
- It does not return any value.
- Syntax: unset(var1, var2,.......);
0 Comment(s)