File: //home/seopositiveltd.co.uk/tutorials-sub/2010/06.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="https://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>
June « 2010 « SEO Positive: SEO Tutorials, PPC Pay Per Click Tutorials, Web Design & Web Development Tutorials</title>
<link rel="canonical" href="https://www.seopositiveltd.co.uk/tutorials-sub/2010/06" />
<link rel="stylesheet" href="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/style.css" type="text/css" media="screen"/>
<link rel="pingback" href="https://tutorials.seopositiveltd.co.uk/xmlrpc.php"/>
<!--[if IE 6]>
<link rel="stylesheet" href="/wp-content/themes/seopositive/ie6.css" type="text/css" media="screen" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="/wp-content/themes/seopositive/ie7.css" type="text/css" media="screen" />
<![endif]-->
<script src="../../ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" id="contact-form-7-css" href="https://tutorials.seopositiveltd.co.uk/wp-content/plugins/contact-form-7/styles.css?ver=2.4.2" type="text/css" media="all"/>
<script type="text/javascript" src="https://tutorials.seopositiveltd.co.uk/wp-includes/js/jquery/jquery.js?ver=1.4.2"></script>
<link rel="index" title="SEO Positive: SEO Tutorials, PPC Pay Per Click Tutorials, Web Design & Web Development Tutorials" href="https://tutorials.seopositiveltd.co.uk"/>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body class="archive date">
<div id="wrapper">
<div class="hidden"></div>
<div id="header">
<div class="hidden">
</div>
<div id="logo"><a href="https://www.seopositive.co.uk/"></a></div>
<div id="header-info">
<div class="menu-top-container"><ul id="menu-top" class="menu"><li id="menu-item-4228" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-4228"><a href="https://my.seopositive.co.uk/">Client Login</a></li>
<li id="menu-item-4227" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-4227"><a href="https://www.seopositive.co.uk/careers.php">Careers</a></li>
<li id="menu-item-4229" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-4229"><a href="https://www.seopositive.co.uk/partners.php">Partners</a></li>
</ul></div>
<div class="clear"></div>
<div class="call-us"> 0800 088 6000</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div id="content-container">
<div id="content" class="narrowcolumn" role="main">
<ul id="menu-main">
<li><a href="/">Home</a>
<ul class="first"><li><a href="/">Home</a></li></ul>
</li>
<li><a href="../../about-us">About us</a>
<ul><li><a href="../../about-us">About us</a></li></ul>
</li>
<li><a>Services</a>
<ul class="dropdown"><li><a>Services</a></li></ul>
<ul class="services-bg">
<ul>
<li><a href="../../search-engine-optimisation">Search Engine Optimisation</a></li>
<li><a href="../../pay-per-click">Pay Per Click</a></li>
<li><a href="https://www.webdesignpositive.co.uk/">Website Design</a></li>
<li><a href="../../website-design-portfolio">Design Portfolio</a></li>
</ul>
<ul>
<li><a href="../../email-marketing">Email Marketing</a></li>
<li><a href="../../reputation-management">Reputation Management</a></li>
<li><a href="../../link-building">Link Building</a></li>
<li><a href="../../hosting">Hosting</a></li>
</ul>
<div class="clear"></div>
</ul>
</li>
<li><a href="../../search-engine-optimisation">SEO Services</a>
<ul><li><a href="../../search-engine-optimisation">SEO Services</a></li></ul>
</li>
<li><a href="../../pay-per-click">PPC Services</a>
<ul><li><a href="../../pay-per-click">PPC Services</a></li></ul>
</li>
<li><a>Testimonials</a>
<ul class="dropdown"><li><a>Testimonials</a></li></ul>
<ul class="testimonials-bg">
<ul>
<li><a href="../../seo-testimonials">Search Engine Optimisation</a></li>
<li><a href="../../ppc-testimonials">Pay Per Click</a></li>
<li><a href="../../web-design-testimonials">Website Design</a></li>
</ul>
<div class="clear"></div>
</ul>
</li>
<li><a href="../../awards">Awards</a>
<ul><li><a href="../../awards">Awards</a></li></ul>
</li>
<li><a href="../../contact-us">Contact us</a>
<ul><li><a href="../../contact-us">Contact us</a></li></ul>
</li>
<li><a>Blog</a>
<ul class="last"><li><a href="../../blog">Blog</a></li></ul>
</li>
</ul>
<div id="main-content">
<div id="content-left">
<div class="post-131 post type-post hentry category-apache category-php category-php-framework tag-cakephp tag-codeigniter tag-dframewerk tag-framework tag-php tag-php-frameworks tag-yii tag-zend-framework" id="post-131">
<h2><a href="/" rel="bookmark" title="Permanent Link to PHP Frameworks – Which one for your project?">PHP Frameworks - Which one for your project?</a></h2>
<hr/>
<p><small>June 29th, 2010 <!-- by admin --></small></p>
<div class="entry">
<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><iframe src="https://api.tweetmeme.com/button.js?url=http%3A%2F%2Ftutorials.seopositiveltd.co.uk%2Fphp-frameworks-which-one-for-your-project.php&style=normal" height="61" width="50" frameborder="0" scrolling="no"></iframe></div>
<p>So there are a number of PHP frameworks out there, hundreds in fact but how do you know which one is best?</p>
<p>Well it depends on who you are and what you do, then it depends on your project, and a third argument to this is how long do you have to finish your project?</p>
<p>All things to consider whenever you’re thinking of changing your working pattern/s</p>
<p>If you’re a beginner to PHP and don’t understand what a framework is I’ll explain as best and as simply as I can below.</p>
<p>A framework, in this case for PHP, is a collection of scripts and or extensions to make and utilize PHP’s native functionality faster, more coherent and safer.</p>
<h3>So whats an MVC?</h3>
<p>If the said framework boasts about being an MVC framework, MVC is Model View Controller. This simply means its built with classes, objects and namespaces meaning its easy to extend, make chain-able etc (There generally just better, its not worth arguing)</p>
<p>So what are the top frameworks?</p>
<p>A quick Google search suggests that the top frameworks are (in no particular order)</p>
<ul>
<li>Zend Framework</li>
<li>CakePHP</li>
<li>dFramewerk</li>
<li>CodeIgniter</li>
<li>Yii</li>
</ul>
<p>And personal experience with each one is good, so I’ll tell you my tales first hand. Zend Framework is a massively complicated framework, but it is equally massive-ly helpful and technical great for large scale future proof sites.</p>
<p>CakePHP is a PHP framework for Ruby lovers, the framework was modeled on Ruby’s structure and is therefor great for creating Ruby styled applications</p>
<p>dFramewerk is a very simple framework aimed for beginners, extend-able and incredibly easy to learn (easiest out of the above in my personal opinion) and powerful, Built with jQuery’s famous ‘Do more, Write less’ motto in mind.</p>
<p>codeIgniter is a fantastic framework for building medium to large websites and applications with a very light footprint on your code and a non-restrictive style of coding.</p>
<p>Yii is a performance based PHP framework (and probably my least favorite from all of the above) it is a very raw framework and I sometimes wonder about its purpose and if it should be classed as a framework. But hey ho I shan’t spit stones at it. Its very raw and very extendable and as close as you can get to coding PHP, not recommended for beginners.</p>
<p>So to gauge what framework for what project, you should think how big is the site going to start off as and how big, how quickly, do you think it will get because you don’t want to be redeveloping your website now do you?</p>
<p>At SEO Positive we use a mixture of the dFramewerk and a customised codeIgniter set up so to offer my recommendations would be biased, but these are my personal favorites and they’re both great for beginners to learn and long term, great performers.</p>
</div>
<p class="postmetadata">Tags: <a href="/" rel="tag">cakephp</a>, <a href="/" rel="tag">codeigniter</a>, <a href="/" rel="tag">dframewerk</a>, <a href="/" rel="tag">framework</a>, <a href="https://www.seopositiveltd.com/blog/tag" rel="tag">php</a>, <a href="/" rel="tag">php frameworks</a>, <a href="/" rel="tag">yii</a>, <a href="/" rel="tag">zend framework</a><br/> Posted in <a href="../../tutorials-sub/category/apache" title="View all posts in apache" rel="category tag">apache</a>, <a href="../../tutorials-sub/category/php" title="View all posts in php" rel="category tag">php</a>, <a href="../../tutorials-sub/category/php/php-framework" title="View all posts in php framework" rel="category tag">php framework</a></p>
</div>
<div class="post-127 post type-post hentry category-css category-htmlxhtml category-seo tag-css tag-html tag-search-engine-optimisation tag-seo tag-xhtml" id="post-127">
<h2><a href="/" rel="bookmark" title="Permanent Link to HTML Scroll box tutorial">HTML Scroll box tutorial</a></h2>
<hr/>
<p><small>June 24th, 2010 <!-- by admin --></small></p>
<div class="entry">
<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><iframe src="https://api.tweetmeme.com/button.js?url=http%3A%2F%2Ftutorials.seopositiveltd.co.uk%2Fhtml-scroll-box-tutorial.php&style=normal" height="61" width="50" frameborder="0" scrolling="no"></iframe></div>
<p>So you want to add more content to your website, but you only have a limited space to do it in. The solution is a scroll box!</p>
<p>Scroll boxes are an easy, clean way of adding an unlimited amount of content to a website without damaging the aesthetic looks at all.</p>
<p>An example of a scroll box is below</p>
<div style="height: 100px; overflow: auto;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque porttitor diam feugiat neque porta sollicitudin. Suspendisse vitae ligula metus, a convallis velit. Donec ornare auctor augue nec rutrum. Duis ut massa a elit convallis vestibulum id non mauris. Suspendisse risus diam, pellentesque ac sagittis ac, mattis vel enim. Sed at dolor in neque mattis elementum. Aenean ornare aliquam malesuada. Morbi adipiscing, urna ac placerat venenatis, mauris libero mattis odio, at vestibulum libero nulla nec sem. Proin ultrices sagittis nulla, vitae malesuada augue congue et. Nulla nec porta felis. Praesent tristique laoreet est, vitae cursus purus lacinia eu. Nulla iaculis massa vel erat lacinia quis adipiscing libero molestie. Nulla sem sapien, dignissim ac venenatis vel, auctor et erat. Nam sollicitudin, mauris eget blandit pulvinar, dolor enim tincidunt justo, eget feugiat purus odio id lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque ornare purus rhoncus dui fermentum viverra. Nulla posuere mauris accumsan erat ornare vel tempor lacus auctor. Proin id lorem arcu. Donec at lobortis eros. Proin id magna lacus, sit amet viverra ligula.</p>
<p>Donec id ligula et dui molestie euismod. Ut lacus justo, tincidunt a ultricies vel, rhoncus vitae neque. Aliquam erat volutpat. Donec porta, dui non egestas mollis, justo sapien accumsan metus, quis fringilla mauris leo eget dolor. Donec pretium varius enim a pharetra. Maecenas dictum, nibh vitae ullamcorper mattis, neque lectus gravida nibh, et convallis tortor enim consequat lectus. Proin blandit eros metus. Sed vestibulum odio a ipsum adipiscing lacinia. Etiam odio nunc, consectetur tristique consequat et, fringilla in felis. Maecenas et sagittis orci. Nulla facilisi. Morbi volutpat magna et orci pellentesque fringilla.</p>
<p>Quisque ac libero ac metus tristique consequat. Curabitur euismod, ligula et luctus adipiscing, magna dolor ultrices ligula, nec fringilla neque tortor in sem. Ut ornare ipsum a lectus tempor iaculis. Donec auctor molestie orci vel ultrices. Integer semper faucibus orci, et tempus velit tincidunt eget. In gravida ligula eu libero mollis feugiat. Aliquam pulvinar congue velit, eu tincidunt nibh euismod eget. Donec vel lorem orci. Maecenas sit amet diam tortor. Sed sit amet tincidunt ante. Donec lorem sapien, congue placerat elementum sit amet, varius a mauris. Proin ac arcu nec tellus feugiat vestibulum.</p>
<p>Donec at lorem ut elit ornare imperdiet eget id augue. Morbi interdum facilisis sodales. Sed in erat est. Cras porta accumsan mollis. Morbi eu massa quis enim suscipit sollicitudin. Vestibulum a leo risus, non dictum purus. Nam at nisi lacinia massa molestie auctor. Fusce dictum nulla eu nunc mollis eu egestas velit malesuada. Integer commodo lobortis ligula quis porta. Fusce porttitor ullamcorper nisi at auctor. Integer tempus tempus posuere. Vivamus iaculis luctus hendrerit. Cras a orci nec erat placerat ultricies et eu ante. Nullam nec lacus nibh, id molestie ipsum.</p>
</div>
<p>As you can see, there’s an awful lot of content in that box, but its only a set height. See below for the code used in this tutorial.</p>
<pre class="brush: php"><div style="height:100px;width:100%;overflow:auto;">
<p>Your content here...</p>
</div>
</pre>
<p>All you have to do is change the height and width to match your requirements and its as easy as that!</p>
</div>
<p class="postmetadata">Tags: <a href="/" rel="tag">css</a>, <a href="/" rel="tag">html</a>, <a href="/" rel="tag">search engine optimisation</a>, <a href="/" rel="tag">seo</a>, <a href="/" rel="tag">xhtml</a><br/> Posted in <a href="../../tutorials-sub/category/css" title="View all posts in css" rel="category tag">css</a>, <a href="../../tutorials-sub/category/htmlxhtml" title="View all posts in html/xhtml" rel="category tag">html/xhtml</a>, <a href="../../tutorials-sub/category/seo" title="View all posts in seo" rel="category tag">seo</a></p>
</div>
<div class="post-122 post type-post hentry category-joomla category-php category-seo tag-joomla tag-joomla-suffix tag-joomla-tutorial tag-php tag-php-tutorials" id="post-122">
<h2><a href="/" rel="bookmark" title="Permanent Link to Joomla suffix changing">Joomla suffix changing</a></h2>
<hr/>
<p><small>June 22nd, 2010 <!-- by admin --></small></p>
<div class="entry">
<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><iframe src="https://api.tweetmeme.com/button.js?url=http%3A%2F%2Ftutorials.seopositiveltd.co.uk%2Fchange-joomla-suffix.php&style=normal" height="61" width="50" frameborder="0" scrolling="no"></iframe></div>
<p>At SEO Positive, we have started to roll more and more sites out based on the Joomla engine. And recently we hit a wall with changing the suffix for SEO Purposes.</p>
<p>Joomla’s built in SEF (Search Engine Friendly) engine has a few nice features such as search engine friendly URL’s and adding a suffix to your paths.</p>
<p>But the default Joomla suffix is .html which you can’t change without some programming knowledge. So I’ve decided to write a tutorial on how to go about adding your very own suffix to Joomla in case you need something other than .html.</p>
<p>This is tested and works with Joomla Version 1.5.17 and may or may not work with older and future versions of Joomla.</p>
<p>To add your own suffix see the code below, I’ll explain what to do with it underneath.<br/>
(Note: You need to have Search Engine Friendly URL’s turned <strong>ON</strong>)</p>
<pre class="brush: php">// open /includes/router.php and head to line 57
{
if($suffix = pathinfo($path, PATHINFO_EXTENSION))
{
$path = str_replace('.'.$suffix, , $path);
$vars['format'] = $suffix;
if ($suffix == 'php') {
$path = str_replace('.'.$suffix, , $path);
$vars['format'] = 'html';
} else {
$path = str_replace('.'.$suffix, , $path);
$vars['format'] = $suffix;
}
}
}
}
</pre>
<p>In my router.php this was line 57 (before any editing), you should see an if() statement something like the one below on line 56</p>
<pre class="brush: php">if($app->getCfg('sef_suffix') && !(substr($path, -9) == 'index.php' || substr($path, -1) == '/'))
</pre>
<p>And what you have to do is replace from line 57 to 64 with the above code.</p>
<p>The next patch is on line 93, you need to replace from 93 to 99 with the below pasted code.</p>
<pre class="brush: php">{
if($format = $uri->getVar('format', 'php'))
{
$route .= '.php';
$uri->delVar('format');
}
}
</pre>
<p>Once you’ve done that and uploaded to your server you should see all your .html suffixes have changed to .php</p>
<p>I strongly recommend, if you have no programming knowledge, to ask a friend to help you with this. I have attached the source file to this post for reference and or use.</p>
<p><a href="https://tutorials.seopositive.com/tutorials-source/router.php.zip">Patched router.php Download</a></p>
</div>
<p class="postmetadata">Tags: <a href="/" rel="tag">joomla</a>, <a href="/" rel="tag">joomla suffix</a>, <a href="/" rel="tag">joomla tutorial</a>, <a href="https://www.seopositiveltd.com/blog/tag" rel="tag">php</a>, <a href="/" rel="tag">PHP Tutorials</a><br/> Posted in <a href="../../tutorials-sub/category/joomla" title="View all posts in joomla" rel="category tag">joomla</a>, <a href="../../tutorials-sub/category/php" title="View all posts in php" rel="category tag">php</a>, <a href="../../tutorials-sub/category/seo" title="View all posts in seo" rel="category tag">seo</a></p>
</div>
<div class="post-111 post type-post hentry category-brain-candy category-css category-htmlxhtml category-javascript category-seo tag-css tag-html-5 tag-html5 tag-javascript tag-php tag-web-application tag-xhtml-2 tag-xhtml2" id="post-111">
<h2><a href="../../tutorials-sub/html-5-good-for-seo" rel="bookmark" title="Permanent Link to HTML 5 good for SEO?">HTML 5 good for SEO?</a></h2>
<hr/>
<p><small>June 21st, 2010 <!-- by admin --></small></p>
<div class="entry">
<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><iframe src="https://api.tweetmeme.com/button.js?url=http%3A%2F%2Ftutorials.seopositiveltd.co.uk%2Fhtml-5-good-for-seo.php&style=normal" height="61" width="50" frameborder="0" scrolling="no"></iframe></div>
<p>With HTML 5 and XHTML 2 just round the corner more and more developers are getting excited at the new possibilities available on the web. But are these new technologies actually good for your website.</p>
<p>The simple answer is.</p>
<h5>YES</h5>
<p>HTML 5 and XHTML 2 are great for your SEO, but building with them can be difficult with non standards browsers *cough* Internet Explorer *cough* not being prepared for these new elements.</p>
<p>A short list of some of the new elements to help better segregate your pages is below:</p>
<p>Tags for layout segregation</p>
<ul>
<li>article - the main content of the page</li>
<li>aside - extra content</li>
<li>figure - peripheral content with caption</li>
<li>footer - the footer of the page</li>
<li>header - the header of the page</li>
<li>nav - the page navigation</li>
<li>section - any section or portion of the page</li>
</ul>
<p>Tags for media segregation:</p>
<ul>
<li>audio - denoting an audio stream</li>
<li>source - the video or audio source files</li>
<li>video - denoting a video stream</li>
</ul>
<p>Tags for DHTML, Ajax and general web application</p>
<ul>
<li>canvas - a place to draw dynamic graphics</li>
<li>command - denotes a command button that has information sent to the server or script</li>
<li>datagrid - references dynamic data in a tree form or tabular data form</li>
<li>datalist - references a list of data in a drop-down list</li>
<li>details - provides additional details of a page element, like pop-up help text</li>
<li>output - references the output of a script or calculation</li>
<li>progress - represents a progress bar in the completion of a process</li>
</ul>
<p>There are more tags but these are what will make your web development change and your thought process behind building your website will alter for a more semantically correct website.</p>
<p>But as I mentioned above, there are still some browsers (a browser) falling behind (never caught up)</p>
<p>But there is a work around using JavaScript. See below for how to make these elements work with Internet Explorer versions 5+</p>
<pre class="brush: php">document.createElement('article');//create a dom element "article"
document.createElement('footer');//create a dom element "footer"
document.createElement('header');//create a dom element "header"
</pre>
<p>As you can see, its pretty simple and it simply tells Internet Explorer based browsers to create these elements in the dom ready for use, So far I have not tested this with validation. But validation is nothing more than a little badge at the bottom of your pages these days, its almost as overused as the Glider (see below)</p>
<p></p>
<p>So HTML 5 and xHTML is good for SEO because search engines can now tell what section of your website is for what, such as header and footer give the search engines a rough idea of what kind of content to expect and article/section tell the search engines that this is where the main bulk of your content lays.</p>
<p>So a more semantic web should mean a more relevant web and less SERP spammers destroying positions.</p>
<p>With that, HTML 5 and xHTML2 are just around the corner and so is the more semantic, clever and aesthetically pleasing web.</p>
</div>
<p class="postmetadata">Tags: <a href="/" rel="tag">css</a>, <a href="/" rel="tag">html 5</a>, <a href="/" rel="tag">html5</a>, <a href="/" rel="tag">javascript</a>, <a href="https://www.seopositiveltd.com/blog/tag" rel="tag">php</a>, <a href="/" rel="tag">web application</a>, <a href="/" rel="tag">xhtml 2</a>, <a href="/" rel="tag">xhtml2</a><br/> Posted in <a href="../../tutorials-sub/category/brain-candy" title="View all posts in Brain Candy" rel="category tag">Brain Candy</a>, <a href="../../tutorials-sub/category/css" title="View all posts in css" rel="category tag">css</a>, <a href="../../tutorials-sub/category/htmlxhtml" title="View all posts in html/xhtml" rel="category tag">html/xhtml</a>, <a href="../../tutorials-sub/category/javascript" title="View all posts in javascript" rel="category tag">javascript</a>, <a href="../../tutorials-sub/category/seo" title="View all posts in seo" rel="category tag">seo</a></p>
</div>
<div class="post-112 post type-post hentry category-brain-candy category-php tag-php tag-php-tutorial" id="post-112">
<h2><a href="/" rel="bookmark" title="Permanent Link to Scan a directory with PHP">Scan a directory with PHP</a></h2>
<hr/>
<p><small>June 15th, 2010 <!-- by admin --></small></p>
<div class="entry">
<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><iframe src="https://api.tweetmeme.com/button.js?url=http%3A%2F%2Ftutorials.seopositiveltd.co.uk%2Fscan-a-directory-with-php.php&style=normal" height="61" width="50" frameborder="0" scrolling="no"></iframe></div>
<p>PHP is a powerful technology, used by a large percentage of the online programming community. Its constantly growing and evolving and consistently provides developers with ripe methods to build web page, and now with the GUI, offline applications for general use and even professional use.</p>
<p>But today we are going to learn how to scan a directory of files and return a list, or index, of all the files contained in the directory. Although we are not going to go into recursive scanning (maybe in another tutorial?)</p>
<p>Its actually really simple and you can even use wildcards (isn’t PHP just a god send?) See the code below, this is using the glob functionality and a simple foreach loop.</p>
<pre class="brush: php">//the * symbol represents a wildcard, meaning show everything
$files = glob('directory/to/my/files/*');
//the foreach loop is very simple
foreach($files as $file){
echo "{$file}<br />";
}
</pre>
<p>Its a very small amount of code that can produce large amounts of data very quickly, we at SEO Positive use this particular function for a lot of our automation (although, we secure ours down a lot more)</p>
<p>Its great for including bulk images, see the example below for a slightly more complex version that includes the most common image types</p>
<pre class="brush: php">//the * symbol represents a wildcard, meaning show everything
$files = glob('directory/to/my/files/{*.jpg,*.png,*.gif,*.bmp}', GLOB_BRACE);
//the foreach loop is very simple
foreach($files as $file){
echo "{$file}<br />";
}
</pre>
<p>The above example uses a filter, GLOB_BRACE. The filter searches for each matching file contained in the braces to its direct left. This example will include all jpg, png, gif and bitmap images in the supplied directory.</p>
<p>The function is not limited to the above examples, but they are a good start and example of this functions amazing capability for simplifying directory scanning.</p>
</div>
<p class="postmetadata">Tags: <a href="https://www.seopositiveltd.com/blog/tag" rel="tag">php</a>, <a href="/" rel="tag">php tutorial</a><br/> Posted in <a href="../../tutorials-sub/category/brain-candy" title="View all posts in Brain Candy" rel="category tag">Brain Candy</a>, <a href="../../tutorials-sub/category/php" title="View all posts in php" rel="category tag">php</a></p>
</div>
<div class="navigation">
<div class="alignleft"><p><a href="/">« Older Entries</a></p></div>
<div class="alignright"><p></p></div>
</div>
<div class="clear"></div>
<hr/>
</div>
<div id="sidebar">
<h3 class="widget-title">Categories</h3> <ul>
<li class="cat-item cat-item-10"><a href="../../tutorials-sub/category/apache" title="View all posts filed under apache">apache</a>
</li>
<li class="cat-item cat-item-3"><a href="../../tutorials-sub/category/brain-candy" title="View all posts filed under Brain Candy">Brain Candy</a>
</li>
<li class="cat-item cat-item-214"><a href="../../tutorials-sub/category/cms" title="View all posts filed under CMS">CMS</a>
</li>
<li class="cat-item cat-item-66"><a href="../../tutorials-sub/category/other-technology/cold-fusion" title="View all posts filed under cold fusion">cold fusion</a>
</li>
<li class="cat-item cat-item-29"><a href="../../tutorials-sub/category/command-line-editors" title="View all posts filed under Command Line Editors">Command Line Editors</a>
</li>
<li class="cat-item cat-item-206"><a href="../../tutorials-sub/category/pay-per-click-ppc/conversion-tracking-pay-per-click-ppc" title="View all posts filed under Conversion Tracking">Conversion Tracking</a>
</li>
<li class="cat-item cat-item-11"><a href="../../tutorials-sub/category/css" title="View all posts filed under css">css</a>
</li>
<li class="cat-item cat-item-133"><a href="../../tutorials-sub/category/pay-per-click-ppc/display-network" title="View all posts filed under Display Network">Display Network</a>
</li>
<li class="cat-item cat-item-174"><a href="../../tutorials-sub/category/google-1" title="View all posts filed under Google +1">Google +1</a>
</li>
<li class="cat-item cat-item-132"><a href="../../tutorials-sub/category/pay-per-click-ppc/google-adwords-2" title="View all posts filed under Google Adwords">Google Adwords</a>
</li>
<li class="cat-item cat-item-115"><a href="../../tutorials-sub/category/web-analytics/google-analytics" title="View all posts filed under google analytics">google analytics</a>
</li>
<li class="cat-item cat-item-102"><a href="../../tutorials-sub/category/shopping-feeds/google-product-feed" title="View all posts filed under Google Product Feed">Google Product Feed</a>
</li>
<li class="cat-item cat-item-190"><a href="../../tutorials-sub/category/shopping-feeds/google-shopping-shopping-feeds" title="View all posts filed under Google Shopping">Google Shopping</a>
</li>
<li class="cat-item cat-item-200"><a href="../../tutorials-sub/category/google-webmaster" title="View all posts filed under Google Webmaster">Google Webmaster</a>
</li>
<li class="cat-item cat-item-12"><a href="../../tutorials-sub/category/htmlxhtml" title="View all posts filed under html/xhtml">html/xhtml</a>
</li>
<li class="cat-item cat-item-128"><a href="../../tutorials-sub/category/illustrator" title="View all posts filed under Illustrator">Illustrator</a>
</li>
<li class="cat-item cat-item-13"><a href="../../tutorials-sub/category/javascript" title="View all posts filed under javascript">javascript</a>
</li>
<li class="cat-item cat-item-42"><a href="../../tutorials-sub/category/joomla" title="View all posts filed under joomla">joomla</a>
</li>
<li class="cat-item cat-item-22"><a href="../../tutorials-sub/category/jquery" title="View all posts filed under jQuery">jQuery</a>
</li>
<li class="cat-item cat-item-21"><a href="../../tutorials-sub/category/jquery-tutorial" title="View all posts filed under jQuery Tutorial">jQuery Tutorial</a>
</li>
<li class="cat-item cat-item-27"><a href="../../tutorials-sub/category/linux" title="View all posts filed under Linux">Linux</a>
</li>
<li class="cat-item cat-item-41"><a href="../../tutorials-sub/category/mootools" title="View all posts filed under mootools">mootools</a>
</li>
<li class="cat-item cat-item-14"><a href="../../tutorials-sub/category/mysql" title="View all posts filed under mysql">mysql</a>
</li>
<li class="cat-item cat-item-71"><a href="../../tutorials-sub/category/mysql/mysqli" title="View all posts filed under MySQLi">MySQLi</a>
</li>
<li class="cat-item cat-item-131"><a href="../../tutorials-sub/category/pay-per-click-ppc" title="View all posts filed under Pay Per Click PPC">Pay Per Click PPC</a>
</li>
<li class="cat-item cat-item-67"><a href="../../tutorials-sub/category/other-technology/perl" title="View all posts filed under perl">perl</a>
</li>
<li class="cat-item cat-item-19"><a href="../../tutorials-sub/category/photoshop" title="View all posts filed under Photoshop">Photoshop</a>
</li>
<li class="cat-item cat-item-9"><a href="../../tutorials-sub/category/php" title="View all posts filed under php">php</a>
</li>
<li class="cat-item cat-item-51"><a href="../../tutorials-sub/category/php/php-framework" title="View all posts filed under php framework">php framework</a>
</li>
<li class="cat-item cat-item-69"><a href="../../tutorials-sub/category/php/programming-php" title="View all posts filed under Programming PHP">Programming PHP</a>
</li>
<li class="cat-item cat-item-169"><a href="../../tutorials-sub/category/robots-txt" title="View all posts filed under robots.txt">robots.txt</a>
</li>
<li class="cat-item cat-item-134"><a href="../../tutorials-sub/category/pay-per-click-ppc/search-network" title="View all posts filed under Search Network">Search Network</a>
</li>
<li class="cat-item cat-item-23"><a href="../../tutorials-sub/category/seo" title="View all posts filed under seo">seo</a>
</li>
<li class="cat-item cat-item-101"><a href="../../tutorials-sub/category/shopping-feeds" title="View all posts filed under Shopping Feeds">Shopping Feeds</a>
</li>
<li class="cat-item cat-item-1"><a href="../../tutorials-sub/category/uncategorized" title="View all posts filed under Uncategorized">Uncategorized</a>
</li>
<li class="cat-item cat-item-28"><a href="../../tutorials-sub/category/unix" title="View all posts filed under Unix">Unix</a>
</li>
<li class="cat-item cat-item-114"><a href="../../tutorials-sub/category/web-analytics" title="View all posts filed under web analytics">web analytics</a>
</li>
<li class="cat-item cat-item-62"><a href="../../tutorials-sub/category/website-design" title="View all posts filed under website design">website design</a>
</li>
<li class="cat-item cat-item-39"><a href="../../tutorials-sub/category/wordpress" title="View all posts filed under wordpress">wordpress</a>
</li>
</ul>
<h3 class="widget-title">Archives</h3> <ul>
<li><a href="../../tutorials-sub/2011/11" title="November 2011">November 2011</a></li>
<li><a href="../../tutorials-sub/2011/10" title="October 2011">October 2011</a></li>
<li><a href="../../tutorials-sub/2011/09" title="September 2011">September 2011</a></li>
<li><a href="../../tutorials-sub/2011/08" title="August 2011">August 2011</a></li>
<li><a href="../../tutorials-sub/2011/07" title="July 2011">July 2011</a></li>
<li><a href="../../tutorials-sub/2011/04" title="April 2011">April 2011</a></li>
<li><a href="../../tutorials-sub/2011/03" title="March 2011">March 2011</a></li>
<li><a href="../../tutorials-sub/2011/02" title="February 2011">February 2011</a></li>
<li><a href="../../tutorials-sub/2011/01" title="January 2011">January 2011</a></li>
<li><a href="../../tutorials-sub/2010/12" title="December 2010">December 2010</a></li>
<li><a href="../../tutorials-sub/2010/11" title="November 2010">November 2010</a></li>
<li><a href="../../tutorials-sub/2010/10" title="October 2010">October 2010</a></li>
<li><a href="../../tutorials-sub/2010/09" title="September 2010">September 2010</a></li>
<li><a href="../../tutorials-sub/2010/08" title="August 2010">August 2010</a></li>
<li><a href="../../tutorials-sub/2010/07" title="July 2010">July 2010</a></li>
<li><a href="../../tutorials-sub/2010/06" title="June 2010">June 2010</a></li>
<li><a href="../../tutorials-sub/2010/05" title="May 2010">May 2010</a></li>
</ul>
<h3 class="widget-title">Blogroll</h3>
<ul class="xoxo blogroll">
<li><a href="https://www.seopositive.co.uk/cheap-seo.php">Cheap SEO</a></li>
<li><a href="https://www.integratedcctv.co.uk/" title="Integrated CCTV, Security, news and reviews">Integrated CCTV</a></li>
<li><a href="https://www.payperclick.org/">Pay Per Click Management</a></li>
<li><a href="https://www.payday-loans.co.uk/">Payday Loans</a></li>
<li><a href="https://www.seopositive.co.uk/pay-per-click.php">PPC Marketing</a></li>
<li><a href="https://www.searchengineoptimisation.org.uk/">Search Engine Optimisation</a></li>
<li><a href="https://www.seopositive.co.uk/">SEO</a></li>
<li><a href="https://www.seopositive.co.uk/blog">SEO Blog</a></li>
<li><a href="https://www.seopositive.net/">SEO Positive</a></li>
<li><a href="https://my.seopositive.co.uk/">SEO Positive</a></li>
<li><a href="https://news.seopositive.co.uk/">SEO Positive News</a></li>
<li><a href="https://tutorials.seopositive.co.uk/">SEO Positive Tutorials</a></li>
<li><a href="https://www.promocodes.co.uk/">voucher codes website</a></li>
<li><a href="https://www.seopositive.co.uk/website-design.php">Website Design Company</a></li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div id="footer" role="contentinfo">
<div id="footer-content">
<div class="footer-section">
<h3>Additional Pages</h3>
<div class="menu-additional-pages-container"><ul class="menu" id="menu-additional-pages"><li class="menu-item menu-item-type-custom menu-item-645" id="menu-item-645"><a href="../../my-sub/index">Client Login</a></li>
<li class="menu-item menu-item-type-post_type menu-item-44" id="menu-item-44"><a href="../../terms">Terms & Conditions</a></li>
<li class="menu-item menu-item-type-post_type menu-item-270" id="menu-item-270"><a href="../../privacy-policy">Privacy Policy</a></li>
<li class="menu-item menu-item-type-custom menu-item-2699" id="menu-item-2699"><a href="../../tutorials-sub/index">Tutorials</a></li>
</ul></div></div>
<div class="footer-section">
<h3>Sitemaps & Feeds</h3>
<div class="menu-sitemaps-feeds-container"><ul class="menu" id="menu-sitemaps-feeds"><li class="menu-item menu-item-type-post_type menu-item-697" id="menu-item-697"><a href="../../sitemap">Sitemap</a></li>
<li class="menu-item menu-item-type-custom menu-item-699" id="menu-item-699"><a href="https://www.seopositiveltd.co.uk/sitemap.xml">XML Sitemap</a></li>
<li class="menu-item menu-item-type-custom menu-item-2740" id="menu-item-2740"><a href="../../blog">Blog</a></li>
<li class="menu-item menu-item-type-custom menu-item-2761" id="menu-item-2761"><a href="../../news-sub/index">News</a></li>
</ul></div></div>
<div class="footer-section footer-section-big">
<h3>Our Address</h3>
<p><strong>Chelmsford Head Office</strong><br/>Milstrete House<br/>29 New Street<br/>Chelmsford<br/>CM1 1NT</p>
</div>
<div class="footer-section">
<h3> </h3>
<p><strong>London Head Office</strong><br/>3rd Floor<br/>1 Ropemaker Street<br/>London<br/>EC2Y 9HT</p>
</div>
<div class="footer-section footer-section-small no-padding-right">
<h3>Social Links</h3>
<a href="/" target="_blank" rel="nofollow"></a>
<a href="https://twitter.com/seopositiveltd" target="_blank" rel="nofollow"></a>
<a href="https://www.youtube.com/user/seopositive" target="_blank" rel="nofollow"></a>
<h3>W3C Compliant</h3>
</div>
<div class="clear"></div>
</div>
<div id="footer-btm">
<p>© Copyright 2010 SEO Positive Ltd | Registered company in England & Wales | Company Number: 06643590 | VAT Number: 974449769</p>
</div>
</div>
</div>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/jqueryui.js" type="text/javascript"></script>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/jquery.anythingslider.js" type="text/javascript"></script>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/mac-screen-slider.js" type="text/javascript"></script>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/class.horinaja.jquery.js" type="text/javascript"></script>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/javascript.js" type="text/javascript"></script>
<script src="https://tutorials.seopositiveltd.co.uk/wp-content/themes/seopositive/js/read-more.js" type="text/javascript"></script>
<script type="text/javascript" src="https://tutorials.seopositiveltd.co.uk/wp-content/plugins/contact-form-7/jquery.form.js?ver=2.47"></script>
<script type="text/javascript" src="https://tutorials.seopositiveltd.co.uk/wp-content/plugins/contact-form-7/scripts.js?ver=2.4.2"></script>
<!-- Auto SyntaxHighlighter -->
<script type="text/javascript" src="https://tutorials.seopositiveltd.co.uk/wp-content/plugins/auto-syntaxhighlighter/scripts/shCore.js?ver=3.0.83"></script>
<script type="text/javascript" src="https://tutorials.seopositiveltd.co.uk/wp-content/plugins/auto-syntaxhighlighter/scripts/shBrushPhp.js?ver=3.0.83"></script>
<script type="text/javascript">
(function(){
var corecss = document.createElement('link');
var themecss = document.createElement('link');
var corecssurl = "https://tutorials.seopositiveltd.co.uk/wp-content/plugins/auto-syntaxhighlighter/styles/shCore.css?ver=3.0.83";
if ( corecss.setAttribute ) {
corecss.setAttribute( "rel", "stylesheet" );
corecss.setAttribute( "type", "text/css" );
corecss.setAttribute( "href", corecssurl );
} else {
corecss.rel = "stylesheet";
corecss.href = corecssurl;
}
document.getElementsByTagName("head")[0].appendChild(corecss);
var themecssurl = "https://tutorials.seopositiveltd.co.uk/wp-content/plugins/auto-syntaxhighlighter/styles/shThemeDefault.css?ver=3.0.83";
if ( themecss.setAttribute ) {
themecss.setAttribute( "rel", "stylesheet" );
themecss.setAttribute( "type", "text/css" );
themecss.setAttribute( "href", themecssurl );
} else {
themecss.rel = "stylesheet";
themecss.href = themecssurl;
}
document.getElementsByTagName("head")[0].appendChild(themecss);
})();
SyntaxHighlighter.defaults['auto-links'] = false;
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
<!-- /Auto SyntaxHighlighter -->
</body>
</html>