[edited by: phranque at 2:22 am (utc) on Jul 24, 2014]
[edit reason] exemplified domain [/edit]
</article><p class="introtext">
Need advice? Got a question? Ask our experts in the <a href="https://www.example.com/forum/country/47-example-forum/">Example Forum</a>
</p><?
$uri=$_SERVER['REQUEST_URI'];
if($uri == "/example/foobar")
echo "<div class='left smalltext tight'>
<h3>Basics</h3>
<h4>Foobar Time</h4>
<p>
GMT +8
</p>
<h4>International dialling code</h4>
<p>
+9999
</p>
<h4>Voltage</h4>
<p>
220 volts, 50 Hertz. The UK standard 3 pin plug design is standard throughout Foobar, a legacy of British colonial rule.
</p>
</div>
<nav>";
else
echo "<nav>
<div class='left smalltext'>
<h3>Top FAQs about Foobar</h3>
<ul>
<li>What is the <a href='https://www.example.com/example/foobar-one'>Foobar Warning System</a> on my TV?</li>
<li>What is the <a href='https://www.example.com/example/foobar-two'>Foobar Mass Transit</a>?</li>
</ul></div>";
?><div class="right textleft smalltext"><h3>Latest Foobar Forum Topics</h3>
<?php
require_once '/home/foobar/public_html/carp/carp.php';
CarpConf('cborder','');
CarpConf('iorder','link');
CarpConf('ilinktitles',0);
CarpConf('bitems','<ul>');
CarpConf('aitems','</ul>');
CarpConf('bi','<li>');
CarpConf('ai','</li>');
CarpConf('maxitems',10);
CarpConf('poweredby','');
CarpConf('carperrors',1);
CarpConf('cacheinterval',5);
CarpConf('encodingout','UTF-8');
CarpCacheShow('http://www.example.com/forum/rss/forums/r4-foobar-forum-latest-posts/');
?></div>
</nav>
<div class="clear"></div></div>
perl -pi -e 's|"http://www.example|"https://www.example|g' *.html
Need advice? Got a question? Ask our experts in the <a href="https://www.example.com/forum/country/47-example-forum/">Example Forum</a>
<li>What is the <a href='https://www.example.com/example/foobar-one'>Foobar Warning System</a> on my TV?</li>
<li>What is the <a href='https://www.example.com/example/foobar-two'>Foobar Mass Transit</a>?</li>
[quote][code]Need advice? Got a question? Ask our experts in the <a href="https://www.example.com/forum/country/47-example-forum/">Example Forum</a>
CarpCacheShow('http://www.example.com/forum/rss/forums/r4-foobar-forum-latest-posts/');
By the way is there a way to make this recursive, avoiding the need to visit every directory?
find . -type f -exec perl -pi.bak -e 's/was/is/g' {} \;