<?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>Ersin Acar &#187; wilcard</title>
	<atom:link href="http://ersinacar.com/tag/wilcard/feed" rel="self" type="application/rss+xml" />
	<link>http://ersinacar.com</link>
	<description>PHP and Web Technologies Freak</description>
	<lastBuildDate>Fri, 14 May 2010 11:57:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Wilcard with Unlink in PHP</title>
		<link>http://ersinacar.com/using-wilcard-with-unlink-in-php_92.html</link>
		<comments>http://ersinacar.com/using-wilcard-with-unlink-in-php_92.html#comments</comments>
		<pubDate>Wed, 29 Apr 2009 12:51:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[unlink]]></category>
		<category><![CDATA[wilcard]]></category>

		<guid isPermaLink="false">http://ersinacar.com/?p=92</guid>
		<description><![CDATA[I just found a way to using wilcard with unlink in PHP.
Here is the scenario;
files might be:
120a-some_file1.jpg
210w-some_file1.jpg
some_file123.jpg
480h-some_file1.jpg
somefile.doc
if you want to delete;
120a-some_file1.jpg
200w-some_file1.jpg
480h-some_file1.jpg 
you can use this code;

&#60;?php
foreach&#40; glob&#40;'*-some_file1.jpg'&#41; as $file &#41;&#123;
        unlink&#40;$file&#41;;
&#125;
?&#62;

]]></description>
			<content:encoded><![CDATA[<p>I just found a way to using wilcard with unlink in PHP.<br />
Here is the scenario;<br />
files might be:<br />
120a-some_file1.jpg<br />
210w-some_file1.jpg<br />
some_file123.jpg<br />
480h-some_file1.jpg<br />
somefile.doc</p>
<p>if you want to delete;<br />
120a-some_file1.jpg<br />
200w-some_file1.jpg<br />
480h-some_file1.jpg </p>
<p>you can use this code;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">glob</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*-some_file1.jpg'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$file</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ersinacar.com/using-wilcard-with-unlink-in-php_92.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
