<?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>/home/drscream &#187; search</title>
	<atom:link href="http://www.cyber-tec.org/tag/search/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyber-tec.org</link>
	<description>blog of thomas merkel (alias drscream) - creative coding</description>
	<lastBuildDate>Mon, 02 Jan 2012 17:06:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Search and Replace a Loaded File (with PHP)</title>
		<link>http://www.cyber-tec.org/2007/07/31/search-and-replace-a-loaded-file-with-php/</link>
		<comments>http://www.cyber-tec.org/2007/07/31/search-and-replace-a-loaded-file-with-php/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 21:33:27 +0000</pubDate>
		<dc:creator>drscream</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.cyber-tec.org/2007/07/31/search-and-replace-a-loaded-file-with-php/</guid>
		<description><![CDATA[A simple to use script for loading a file, search and replacing words, and displaying the file. // File to open $file = '/path/to/file.txt'; // Search and Replace Arrays $search = array('soda', 'hamburger', 'ice', 'food'); $replace = array('beer', 'pizza', 'water', 'drink'); // Open the file $lines = file($file); // Read through the file foreach($lines as [...]]]></description>
			<content:encoded><![CDATA[<p>A simple to use script for loading a file, search and replacing words, and displaying the file.</p>
<pre><code>
// File to open
$file = '/path/to/file.txt';
// Search and Replace Arrays
$search = array('soda', 'hamburger', 'ice', 'food');
$replace = array('beer', 'pizza', 'water', 'drink');
// Open the file
$lines = file($file);
// Read through the file
foreach($lines as $line_num => $line) {
    $text = preg_replace($search, $replace, $line);
    echo $text."\n";
}
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cyber-tec.org/2007/07/31/search-and-replace-a-loaded-file-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

