<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unlink image in php - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/unlink-image-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/unlink-image-in-php/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Thu, 04 Aug 2022 05:46:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>unlink image in php - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/unlink-image-in-php/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What does the unlink () function and unset () function mean ?</title>
		<link>https://www.wikitechy.com/interview-questions/php/what-does-the-unlink-function-and-unset-function-mean/</link>
					<comments>https://www.wikitechy.com/interview-questions/php/what-does-the-unlink-function-and-unset-function-mean/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Thu, 04 Aug 2022 05:46:18 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[difference between unlink and unset in php]]></category>
		<category><![CDATA[php unlink file if exists]]></category>
		<category><![CDATA[php unlink not working]]></category>
		<category><![CDATA[unlink image in php]]></category>
		<category><![CDATA[unlink in php with path]]></category>
		<category><![CDATA[what is unlink in php]]></category>
		<category><![CDATA[what is use of header function]]></category>
		<category><![CDATA[what is use of header function in php]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4572</guid>

					<description><![CDATA[The unlink () and unset () functions are used to do some undo operations but used in different situations because both acts differently. unlink () function In PHP unlink () function is used when you want to delete the files completely and it is an inbuilt function. In this the filename of the file which [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">The unlink () and unset () functions are used to do some undo operations but used in different situations because both acts differently.</li>
</ul>
<h2 id="unlink-function" style="text-align: justify;">unlink () function</h2>
<ul style="text-align: justify;">
<li>In PHP unlink () function is used when you want to delete the files completely and it is an inbuilt function.</li>
<li>In this the filename of the file which has to be deleted is sent as a parameter and True on success and False on failure when the function returns.</li>
<li>The unlink () function accepts two parameters in PHP they are filename and context.</li>
<li>The filename is a mandatory parameter which specifies the filename of the file which has to be deleted.</li>
<li>The context is an optional parameter which specifies the context of the file handle which can be used to modify the nature of the stream.</li>
<li>Suppose there is a file named <strong>‘gfg.txt’, </strong>it returns True on success and False on failure.</li>
</ul>
<h2 id="sample-code" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php<br/> <br/>// PHP program to delete a file named gfg.txt<br/>// using unlink() function<br/> <br/>$file_pointer = fopen(&#039;gfg.txt&#039;);<br/> <br/>// Writing on a file named gfg.txt<br/>fwrite($file_pointer, &#039;A computer science portal for Wikitechy!&#039;);<br/>fclose($file_pointer);<br/> <br/>// Using unlink() function to delete a file<br/>unlink(&#039;gfg.txt&#039;);<br/> <br/>?&gt;</code></pre> </div>
<h2 id="output" style="text-align: justify;">Output</h2>
<p style="text-align: justify;"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4573" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function.png" alt="" width="1041" height="169" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function.png 1041w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function-300x49.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function-1024x166.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function-768x125.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function-390x63.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unlink-function-820x133.png 820w" sizes="(max-width: 1041px) 100vw, 1041px" /></p>
<h2 id="unset-function" style="text-align: justify;">unset () function</h2>
<ul style="text-align: justify;">
<li>The unset () function is used when you want to make that file empty and it is an inbuilt function which is used to remove the content from the file by emptying it in PHP.</li>
<li>Thereby making it empty, the unset () function not only clears the file content but also is used to unset a variable.</li>
<li>It means that the function clears the content of a file rather deleting it.</li>
<li>This function accepts single parameter <strong>variable </strong>which is required and it does not return any value.</li>
</ul>
<h2 id="sample-code-2" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php<br/>      <br/>$var = &quot;hello&quot;;<br/>         <br/>// Change would be reflected outside the function <br/>function unset_value() {<br/>    unset($GLOBALS[&#039;var&#039;]);<br/>}<br/>         <br/>unset_value();<br/>echo $var;<br/>?&gt;</code></pre> </div>
<h2 id="output-2" style="text-align: justify;">Output</h2>
<p style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4574" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function.png" alt="" width="1037" height="187" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function.png 1037w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function-300x54.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function-1024x185.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function-768x138.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function-390x70.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/unset-function-820x148.png 820w" sizes="(max-width: 1037px) 100vw, 1037px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/php/what-does-the-unlink-function-and-unset-function-mean/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
