<?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: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-8117294483406544790</id><updated>2011-07-08T11:44:19.002-03:00</updated><category term='PHP 5'/><category term='Games'/><category term='Array'/><category term='Data'/><category term='MySQL'/><category term='Integer'/><category term='Language'/><category term='Control Structures'/><category term='Function'/><category term='Date'/><category term='locale'/><category term='OOP'/><category term='SPL'/><category term='Iteration'/><category term='String'/><category term='Files'/><category term='Ubuntu'/><category term='Good customs'/><category term='CodeIgniter'/><category term='Forms'/><category term='Security'/><category term='Optimization'/><category term='Examples'/><title type='text'>PHP Developing</title><subtitle type='html'>Compilation of advice and techniques for PHP programming</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-6680006304458526399</id><published>2009-12-09T11:04:00.001-03:00</published><updated>2009-12-09T11:05:47.805-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Language'/><category scheme='http://www.blogger.com/atom/ns#' term='locale'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Locale on Ubuntu</title><content type='html'>Using setlocale isn't easy. You have to know the exact name of the language package you want to use,&lt;br /&gt;&lt;br /&gt;On ubuntu, to see the list of available options, we can perform "locale -a". To install a new language,  "apt-get install language-pack-**-base" and then restart apache.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-6680006304458526399?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/6680006304458526399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=6680006304458526399&amp;isPopup=true' title='64 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6680006304458526399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6680006304458526399'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2009/12/locale-on-ubuntu.html' title='Locale on Ubuntu'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>64</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-477932391925387069</id><published>2008-06-05T11:40:00.000-03:00</published><updated>2008-06-05T11:41:13.352-03:00</updated><title type='text'></title><content type='html'>Cool site: &lt;a href="http://www.phpbench.com/"&gt;http://www.phpbench.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-477932391925387069?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/477932391925387069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=477932391925387069&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/477932391925387069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/477932391925387069'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2008/06/cool-site-httpwww.html' title=''/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-1743067772983599542</id><published>2008-03-04T21:25:00.006-02:00</published><updated>2008-03-04T22:01:04.330-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CodeIgniter'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>A model example</title><content type='html'>&lt;div id="result_box" dir="ltr"&gt;In a few hours I've created a trivia in CodeIgniter allowing send questions and answer some that other users sent.&lt;br /&gt;&lt;br /&gt;The code is simple, but the interesting thing I want to show is the work of the models. In application/libraries/MY_Model.php the definition of the models is extended. Then we have the methods "get", "fetchlist", "count" receiving the type of object and an array of filters wanting to apply.&lt;br /&gt;&lt;br /&gt;How are translated filters?&lt;br /&gt;In general, the filters are conditions database. But it also allows "limit", "start", "orderby" and "orderbydir" which is to limit the amount of registration, change the start (offset), the column to sort and how (ASC/DESC) , respectively.&lt;br /&gt;And even more, you can define filters themselves in each model. Defining a method "filter" can set own conditions. The method receives three arguments: object type, key and value. The function should return TRUE if they have a management own filter or FALSE if not. In the example, this can be seen in the model trivia.&lt;br /&gt;&lt;br /&gt;What other methods have defined for the models?&lt;br /&gt;Methods save, update, insert and delete receive an object and store it in the database. These objects should be objects that extend the Data_object class, be prefixed with "obj_" and must be called as the table it uses. Each must define the attributes that will be stored in columns in the database.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://neonetsi.com.ar/seppo/desarrollophp/trivia.zip"&gt;Download example&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-1743067772983599542?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/1743067772983599542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=1743067772983599542&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1743067772983599542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1743067772983599542'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2008/03/model-example.html' title='A model example'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-1615203021281261547</id><published>2008-02-26T23:43:00.001-02:00</published><updated>2008-02-26T23:46:47.968-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Caching data</title><content type='html'>If we are looking for ways to improve our website performance, the cache is the key.&lt;br /&gt;&lt;br /&gt;There are many ways to do this, the most common cache is full pages, but sometimes this is not possible. In these cases, the main thing is to locate the slowest processes and try to save their outcome. To that end, the best thing is to use memcache that allows us to keep one variable (serialized, as a string) and recover very quickly.&lt;br /&gt;&lt;br /&gt;A more generic solution can be implemented in a class that receives data to store, allowing change the way of doing (memcache, database, files), if necessary to migrate the code to a server that does not have the necessary technology.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-1615203021281261547?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/1615203021281261547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=1615203021281261547&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1615203021281261547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1615203021281261547'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2008/02/caching-data.html' title='Caching data'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8901880085885303485</id><published>2008-02-24T16:03:00.004-02:00</published><updated>2008-02-24T16:13:45.703-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CodeIgniter'/><title type='text'>Surviving without GET parameters</title><content type='html'>CodeIgniter does not allow the use of variables GET default, to allow the "friendly URLs" However, parameters can still be passed.&lt;br /&gt;&lt;br /&gt;Suppose a forum, and we want to pass the item number to display the comments. In PHP classic the URL would be view_thread.php?thread_id=1234 but in CI, on the other hand, we can make thread/view/1234. Then the controller is thread, the method view and parameter aditional is 1234.&lt;br /&gt;&lt;br /&gt;How to recover the value of this parameter?&lt;br /&gt;We have two options. We can define it as a parameter of the method view or through the URI class.&lt;br /&gt;The first alternative would be something&lt;br /&gt;&lt;br /&gt;function view($ id = 0)&lt;br /&gt;(&lt;br /&gt;  // And it is defined $ id&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;The second option is&lt;br /&gt;&lt;br /&gt;function  view()&lt;br /&gt;{&lt;br /&gt;  $id = $ this-&gt;uri-&gt;segment(3);&lt;br /&gt;  // And it is defined $id&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The first seems more beautiful, right? Maybe someone will call attention to the parameter = 0 ... Because the user defines the URL the visitor may not send the parameter and this would generate a PHP fatal error, unrecoverable. In this way, we can do that if the id is empty, the user is redirected to an error page or to the list of items ... Basically, fail gracefully.&lt;br /&gt;&lt;br /&gt;This case is simple. However becomes more complicated when the parameters are many. For example, to paginate the theme that we are showing, we can add a fourth parameter, leaving&lt;br /&gt;&lt;br /&gt;function view($id = 0, $page = 1)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;But things can be even more complicated when there are multiple parameters and not necessarily in order of importance (in the previous case, always require an ID, but not always a page number).&lt;br /&gt;Suppose an advanced search form, within the same forum. In addition to keywords, we can select a range of time and a particular user. If we try to apply the same approach, come to something as confusing as&lt;br /&gt;&lt;br /&gt;function results($keywords = '', $from_date = '',$to_date = '', $user = 0)&lt;br /&gt;{&lt;br /&gt;  // ...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;What seems more annoying than friendly. There are several possible solutions.&lt;br /&gt;&lt;br /&gt;Sessions&lt;br /&gt;One possible option is to send the form to a page and store the data in the session, and then knowing that sought to navigate through the session data. Against: if a user does not two searches can "surf" (enter items and return, or use the paging) simultaneously. Against II: can not be shared or saved as bookmarks page of search results.&lt;br /&gt;&lt;br /&gt;Uri Assoc&lt;br /&gt;While we can not do search_results.php?keywords=...&amp;amp;from_date=...&amp;amp;to_date=... We can make a URI associative and use search/results/keywords/.../desde_fecha/.../to_date/... And then take advantage of the method of the URI class uri_to_assoc to achieve a simple associative array.&lt;br /&gt;&lt;br /&gt;Hash&lt;br /&gt;Finally, we may use the URI to send an identifier of the search. For example search/results/bda90d48eda6d07d961b3ec26216fe05 and keep our database criteria mean "bda90d48eda6d07d961b3ec26216fe05".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8901880085885303485?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8901880085885303485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8901880085885303485&amp;isPopup=true' title='148 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8901880085885303485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8901880085885303485'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2008/02/surviving-without-get-parameters.html' title='Surviving without GET parameters'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>148</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8557941924738522721</id><published>2008-02-16T12:54:00.003-02:00</published><updated>2008-02-16T12:59:25.121-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CodeIgniter'/><title type='text'>The first thing to know</title><content type='html'>The object being instance as a controller, has references to all the libraries and models who have instanciated as an attribute of the same name in the class.&lt;br /&gt;So if we load the library Email, we have $ this-&gt;email is an instance of the class email.&lt;br /&gt;&lt;br /&gt;The issue does not end there. Each model also has the same attributes loaded, then we have the code in the controller and the model is similar, as they have the same attributes. So, if we do some code in the controller and we think it is very general and we may need inside another, it's easy to make it a model.&lt;br /&gt;&lt;br /&gt;But ... What if we are in a library?&lt;br /&gt;At libraries this attributes are not loaded, but may need access to another library, or a model. For this, we can access the instance of the controller through the "get_instance" function.&lt;br /&gt;For example, within the class we want to validate the email message with the method valid_email the kind of validation. Then:&lt;br /&gt;&lt;br /&gt;Function valid_email ($ address)&lt;br /&gt;{&lt;br /&gt;     // (&amp;amp; It is important to avoid creating a copy in PHP 4)&lt;br /&gt;    $CI =&amp;amp; get_instance();&lt;br /&gt;&lt;br /&gt;     // If not loaded the library, load it&lt;br /&gt;    if (!isset($CI-&gt;validation))&lt;br /&gt;    {&lt;br /&gt;        $CI-&gt;load-&gt;library('validation');&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;     // Call the method&lt;br /&gt;    return $CI-&gt;validation-&gt;valid_email($address);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Simple, no?&lt;br /&gt;&lt;br /&gt;Still, this follows ...&lt;br /&gt;What if at the view, we want access to a library or model, for example, the validation to retrieve messages?&lt;br /&gt;&lt;br /&gt;The views can also access as $ this-&gt;validation to the same object that the controller or models.&lt;br /&gt;Internally, this is accomplished by assigning these instances to Class Loader, where the views are loaded.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8557941924738522721?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8557941924738522721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8557941924738522721&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8557941924738522721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8557941924738522721'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2008/02/first-thing-to-know.html' title='The first thing to know'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8274125909390977054</id><published>2008-02-16T12:28:00.001-02:00</published><updated>2008-02-16T12:30:40.385-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CodeIgniter'/><title type='text'>Two long months</title><content type='html'>Since my change of job, my free time is shortened and the blog fell into oblivion.&lt;br /&gt;Lately I've dedicate my PHP time to &lt;a href="http://codeigniter.com"&gt;CodeIgniter&lt;/a&gt;, so I am going to start posting on the matter.&lt;br /&gt;&lt;br /&gt;Basics. CodeIgniter is a Framework that works in PHP 4.3.2+. It's very lightweight and very flexible. Inspired by Ruby on rails. Use the MVC pattern. Promotes friendly URLs. The documentation is very good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8274125909390977054?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8274125909390977054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8274125909390977054&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8274125909390977054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8274125909390977054'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2008/02/two-long-months.html' title='Two long months'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-6273085413560184974</id><published>2007-12-16T13:23:00.000-03:00</published><updated>2007-12-16T13:59:23.482-03:00</updated><title type='text'>Reflection Class</title><content type='html'>Since PHP 5 is a set of classes and interfaces that allow us to obtain information about the classes, functions, methods, attributes and objects. This package allows us, for example, to know how many parameters receives a function, and how many are required ... One example of how to use this&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;/**&lt;br /&gt; * This function repeats&lt;br /&gt; *&lt;br /&gt; * @param string $text&lt;br /&gt; * @param integer $times&lt;br /&gt; */&lt;br /&gt;function repeat($text, $times = 2) {&lt;br /&gt;    return str_repeat($text, $times);&lt;br /&gt;}&lt;br /&gt;$reflection = new ReflectionFunction('repeat');&lt;br /&gt;echo 'User defined: ' , $reflection-&gt;isUserDefined() , "\r\n";&lt;br /&gt;echo 'Documentation: ' , $reflection-&gt;getDocComment() , "\r\n";&lt;br /&gt;echo '# Params: ' , $reflection-&gt;getNumberOfParameters() , "\r\n";&lt;br /&gt;foreach ($reflection-&gt;getParameters() as $parametro)&lt;br /&gt;{&lt;br /&gt;    echo 'Parameter "' , $parametro-&gt;getName() , '" ' , ($parametro-&gt;isOptional() ? '' : 'no ') , 'is optional' , "\n";&lt;br /&gt;    echo 'By default: ' , ($parametro-&gt;isDefaultValueAvailable() ? $parametro-&gt;getDefaultValue() : 'doesn\' have any') , "\n";&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-6273085413560184974?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/6273085413560184974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=6273085413560184974&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6273085413560184974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6273085413560184974'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/12/reflection-class.html' title='Reflection Class'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-2200353791622053935</id><published>2007-12-09T23:05:00.000-03:00</published><updated>2007-12-09T23:07:54.323-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data'/><title type='text'>JSON</title><content type='html'>JSON is a format for the transmission of data useful to move from one code to another.&lt;br /&gt;&lt;br /&gt;The most common example is to move an object or an array from PHP to JavaScript and vice versa. For this, PHP 5 provides two features that make the transfer: &lt;a href="http://ar.php.net/json-encode"&gt;json_encode&lt;/a&gt; and &lt;a href="http://ar.php.net/json-decode"&gt;json_decode&lt;/a&gt;. There are classes that offer a similar operation for PHP 4.&lt;br /&gt;&lt;br /&gt;The advantage of this notation is transparency and ease with which data is transmitted. XML is an alternative which also presents its advantages. It is preferable to a series of data, if they want to consult with XQuery, but for the transmission of single data, JavaScript syntax is presented             simpler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-2200353791622053935?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/2200353791622053935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=2200353791622053935&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2200353791622053935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2200353791622053935'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/12/json.html' title='JSON'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-1606113811426484775</id><published>2007-11-27T12:26:00.000-03:00</published><updated>2007-11-27T12:34:13.160-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>Whitelist vs Blacklist</title><content type='html'>When thinking about security, validation and filtering data, we have two options: either decide what to allow or what to prohibit.&lt;br /&gt;&lt;br /&gt;On the one hand, you can use a filter to prevent XSS attacks that are based on finding a regular expression searching javascript code (either script tags or attributes onload, onclick, onmouseover...). This would be blacklist that is, put code that is unusable.&lt;br /&gt;&lt;br /&gt;On the other hand, you can grant HTML tags type b, i, u... and eliminate all the other tags. That would be whitelist, which is, limit the user what it can do.&lt;br /&gt;&lt;br /&gt;What is preferable?&lt;br /&gt;&lt;br /&gt;Using a blacklist you have to think of every possible "attacks" which may accrue. This is a risk, since if we attacker thinks a method which we didn't think, we would have a huge problem. But if instead, we use a whitelist, the user could access only if he fills our standard permitted, that should be much less probable to let an attack succeed.&lt;br /&gt;&lt;br /&gt;The whitelist disadvantage, on the other hand, is that we can filter or not to allow some information that is really valid.&lt;br /&gt;&lt;br /&gt;Then, with a blacklist we most likely to be victims of attacks by malicious hackers, while using a whitelist can leave users without the possibility of correct entries.&lt;br /&gt;&lt;br /&gt;Personally, I think the second option the best, because its consequences are less severe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-1606113811426484775?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/1606113811426484775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=1606113811426484775&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1606113811426484775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1606113811426484775'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/11/whitelist-vs-blacklist.html' title='Whitelist vs Blacklist'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-2033189267382414112</id><published>2007-11-22T13:47:00.000-03:00</published><updated>2007-11-22T13:49:11.812-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP 5'/><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><category scheme='http://www.blogger.com/atom/ns#' term='SPL'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><title type='text'>Mixing array with objects</title><content type='html'>The SPL extension allows us to use objects as array. One way to do this is to use the class predefined ArrayObject. Another way is to implement an interface ArrayAccess to access our data as if they were an array. An example of this&lt;br /&gt;&lt;br /&gt;class MyArray implements ArrayAccess {&lt;br /&gt;    private $data;&lt;br /&gt;&lt;br /&gt;    public function __construct($array = array())&lt;br /&gt;    {&lt;br /&gt;        $this-&gt;data = $array;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function offsetGet($key)&lt;br /&gt;    {&lt;br /&gt;        return $this-&gt;data[$key];&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function offsetSet($key, $value)&lt;br /&gt;    {&lt;br /&gt;        return $this-&gt;data[$key] = $value;&lt;br /&gt;    }&lt;br /&gt;    public function offsetExists($key)&lt;br /&gt;    {&lt;br /&gt;        return isset($this-&gt;data[$key]);&lt;br /&gt;    }&lt;br /&gt;    public function offsetUnset($key)&lt;br /&gt;    {&lt;br /&gt;        unset($this-&gt;data[$key]);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function avg()&lt;br /&gt;    {&lt;br /&gt;        if (count($this-&gt;data) &gt; 0)&lt;br /&gt;        {&lt;br /&gt;            return array_sum($this-&gt;data) / count($this-&gt;data);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;//echo 0xFACEB00C &gt;&gt; 2;&lt;br /&gt;$array = new MyArray(array(1, 2, 3, 4));&lt;br /&gt;echo (int)isset($array[0]);&lt;br /&gt;echo $array[0];&lt;br /&gt;&lt;br /&gt;unset($array[1]);&lt;br /&gt;echo (int)isset($array[1]); //throw an ugly notice&lt;br /&gt;echo $array[1];&lt;br /&gt;&lt;br /&gt;$array[1] = 4;&lt;br /&gt;echo (int)isset($array[1]);&lt;br /&gt;echo $array[1];&lt;br /&gt;&lt;br /&gt;echo $array-&gt;avg();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-2033189267382414112?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/2033189267382414112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=2033189267382414112&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2033189267382414112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2033189267382414112'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/11/mixing-array-with-objects.html' title='Mixing array with objects'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-4636957578332098383</id><published>2007-11-13T22:38:00.000-03:00</published><updated>2007-11-13T22:45:44.785-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Function'/><title type='text'>Find out if a function was called with a parameter default value</title><content type='html'>A function can have optional arguments. They are determined to give it a default value defined. For example&lt;br /&gt;&lt;br /&gt;function test ($key, $value = null)&lt;br /&gt;&lt;br /&gt;But how can we differentiate whether this function is called with only one parameter, or if it is called using two but the second is equal to the default?&lt;br /&gt;The solution is nested but not difficult... We simply need to find how many arguments were passed to the function when called&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Function test ($key, $value = null)&lt;br /&gt;{&lt;br /&gt;  If (func_num_args ()&gt; 1) {&lt;br /&gt;    Echo '$value is sent';&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;test('1', null);&lt;br /&gt;test('1');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-4636957578332098383?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/4636957578332098383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=4636957578332098383&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/4636957578332098383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/4636957578332098383'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/11/find-out-if-function-was-called-with.html' title='Find out if a function was called with a parameter default value'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-5584086025662782106</id><published>2007-11-08T12:34:00.000-03:00</published><updated>2007-11-08T12:46:59.265-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Date'/><category scheme='http://www.blogger.com/atom/ns#' term='Language'/><title type='text'>Naming dates (not in english)</title><content type='html'>It is very common to the problem of wanting to put "November 8, 2007" in a language different from english... In general, a switch is used to translate the name of the month, but there is a much simpler way to do it. PHP brings the ability to configure the location, and then select "regional" settings like language, currency, numbers.&lt;br /&gt;&lt;br /&gt;To do so, we must first set the region with &lt;a href="http://www.php.net/setlocale"&gt;setlocale&lt;/a&gt; and then we can use the date format with &lt;a href="http://us.php.net/strftime"&gt;strftime&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;?php&lt;br /&gt;setlocale(LC_ALL, 'sp');&lt;br /&gt;echo strftime('%d de %B de %Y');&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-5584086025662782106?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/5584086025662782106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=5584086025662782106&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/5584086025662782106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/5584086025662782106'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/11/naming-dates-not-in-english.html' title='Naming dates (not in english)'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-2992009878568586624</id><published>2007-11-05T15:09:00.000-03:00</published><updated>2007-11-05T15:15:40.095-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Games'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>States game</title><content type='html'>Game:&lt;br /&gt;&lt;br /&gt;Take the names of two U.S. States, mix them all together, then rearrange the letters to form the names of two other U.S. States.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/states.zip"&gt;My solution&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Any suggestion?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-2992009878568586624?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/2992009878568586624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=2992009878568586624&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2992009878568586624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2992009878568586624'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/11/states-game.html' title='States game'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-1726302987378270778</id><published>2007-10-30T20:46:00.000-03:00</published><updated>2007-10-30T20:48:38.300-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Improving Pagination</title><content type='html'>Recently I discovered a method to improve the performance of a pagination in MySQL. Generally takes two queries to the database, one for bring the data and another to find out how much data is the total. What is new, though not alter the amount of queries, is that we can make the MySQL server has to process only once.&lt;br /&gt;&lt;br /&gt;How does this work?&lt;br /&gt;In the first request, in addition to requesting the data, we say to the server to calculate the total number of rows of the query, then we do a query to get this information.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM t SQL_CALC_FOUND_ROWS&lt;br /&gt;   -&gt; WHERE id&gt; 100 LIMIT 10;&lt;br /&gt;mysql&gt; SELECT FOUND_ROWS ();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is especially useful if you use an ORDER BY clause, or a complex consultation with subqueries, multiple JOIN or many calculations.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows"&gt; Check MySQL Manual&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-1726302987378270778?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/1726302987378270778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=1726302987378270778&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1726302987378270778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/1726302987378270778'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/10/improving-pagination.html' title='Improving Pagination'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8771801504776563860</id><published>2007-10-25T14:56:00.000-03:00</published><updated>2007-10-25T15:00:05.927-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP 5'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><title type='text'>Autoloading classes</title><content type='html'>Since PHP 5, it is not necessary to load all classes at the beginning of each script, but if there is a function __autoload is called when they want to use a class that does not exist. This function takes the name of the class you want and it must bear responsibility for making that class exist, in order  to avoid the throwing an error because it does not exist.&lt;br /&gt;&lt;br /&gt;This is a good step forward for PHP 5, which since version 5.1.2 also gives us the possibility to register multiple functions to do this, rather than simply just one as was previously, through &lt;a href="http://www.php.net/manual/en/function.spl-autoload-register.php"&gt;spl_autoload_register&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8771801504776563860?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8771801504776563860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8771801504776563860&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8771801504776563860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8771801504776563860'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/10/autoloading-classes.html' title='Autoloading classes'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-6886056637532567078</id><published>2007-10-18T12:46:00.000-03:00</published><updated>2007-10-18T12:54:06.185-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Control Structures'/><title type='text'>Switch with expressions</title><content type='html'>The switch usually are very useful, but also very limited. Looking the way, we can extend its use to evaluate expressions, and call functions. What we have to do is put expressions in the case to be an argument to compare.&lt;br /&gt;&lt;br /&gt;For example, we can do the following&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;switch (true) {&lt;br /&gt;    case ($variable &gt;= 0 &amp;amp;&amp;amp; $variable &lt; 3):&lt;br /&gt;        echo '$variable está entre 0 y 3';&lt;br /&gt;        break;&lt;br /&gt;&lt;br /&gt;    case ($variable &gt;= 3 &amp;amp;&amp;amp; $variable &lt; 7):&lt;br /&gt;        echo '$variable está entre 3 y 7';&lt;br /&gt;        break;&lt;br /&gt;&lt;br /&gt;    case ($variable &gt;= 7):&lt;br /&gt;        echo '$variable es mayor a 7';&lt;br /&gt;        break;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thus, instead of using three chained IFs, we can resort to this option, so that our code is more readable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-6886056637532567078?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/6886056637532567078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=6886056637532567078&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6886056637532567078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6886056637532567078'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/10/switch-with-expressions.html' title='Switch with expressions'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-3939006173495822626</id><published>2007-10-16T22:18:00.000-03:00</published><updated>2007-10-16T22:58:34.441-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Single and double quoted</title><content type='html'>For most people, the single and doubles quotes  in PHP are equal. But fundamental differences exists. Using double quotes there are more special characters: \n \r \t \\ \$ \" \[0-7] (1,3) \x [0-9A-Fa-f] (1,2) while with single quotes we only have \\ \'.&lt;br /&gt;Knowing this already, we can assume that the single quotes are faster. On the other hand, we must add that within the double quotes variables may be used without concatenate, but writing it directly on the string contents.&lt;br /&gt;More information can be found in the PHP manual, in &lt;a href="http://www.php.net/manual/en/language.types.string.php"&gt;String&lt;/a&gt; section.&lt;br /&gt;&lt;br /&gt;Finally, let's compare the times of each, in various circumstances.&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/comillas-dobles-y-simples.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-3939006173495822626?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/3939006173495822626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=3939006173495822626&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3939006173495822626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3939006173495822626'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/10/single-and-double-quoted.html' title='Single and double quoted'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-6836189545130870402</id><published>2007-10-11T17:05:00.000-03:00</published><updated>2007-10-11T17:09:00.686-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Date'/><title type='text'>Handling dates</title><content type='html'>It is normal to have to change the format of a date to suit one type of database, or to be presented to a user. Usually, strtotime is a good tool to do so because it supports the traditional format of MySQL and many others, but the problem is usually when we get a date format dd/ mm/yy, because by default this feature takes American format mm/dd/yy and can be confused with the 01/07 January 7, instead of July 1 that we expected. The solution offered by PHP is the function strptime, which allows us to indicate the format of the date. However, this feature is quite new (since PHP 5.1.0) and is not implemented on Windows, which is quite limited. Therefore, we can create a small function, for this purpose.&lt;br /&gt;&lt;br /&gt;function strtotime2($date)&lt;br /&gt;{&lt;br /&gt;   if (preg_match('#^((0?[1-9])|([1-2]?[0-9])|(3[0-1]))/(0?[1-9]|(1[0-2]))/((19|20)?([0-9]{2}))$#', $date))&lt;br /&gt;   {&lt;br /&gt;       list($day, $month, $year) = explode('/', $date);&lt;br /&gt;       return mktime(0, 0, 0, $month, $day, $year);&lt;br /&gt;   } else&lt;br /&gt;   {&lt;br /&gt;       return strtotime($date);&lt;br /&gt;   }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-6836189545130870402?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/6836189545130870402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=6836189545130870402&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6836189545130870402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6836189545130870402'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/10/handling-dates.html' title='Handling dates'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8343887534116532241</id><published>2007-10-04T14:38:00.000-03:00</published><updated>2007-10-04T14:42:27.149-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Function'/><category scheme='http://www.blogger.com/atom/ns#' term='Good customs'/><title type='text'>Flexible parameters, hard returns</title><content type='html'>When programming a function, or a method of a class, always is the best thing to be able to receive any type of parameter. Analyze if is more comfortable to mix two parameters in one, using an Array, or if a data can be of several types. All these things it is necessary to have them in account so that soon it is less difficult to work with which already it is done. Another thing that we must try is always to return the same data type, even if it were not possible to be made what it was expected, then if an Array is due to return, but was an error we can return an empty Array instead of false or null. A simple example of this&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;function select($nombre, $valores = array(), $seleccionado = '', $atributos = array())&lt;br /&gt;{&lt;br /&gt;   if (!is_array($valores) || count($valores) == 0)&lt;br /&gt;   {&lt;br /&gt;       return '';&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   if (is_string($nombre))&lt;br /&gt;   {&lt;br /&gt;       if (is_array($atributos))&lt;br /&gt;       {&lt;br /&gt;           $atributos['name'] = $nombre;&lt;br /&gt;       } else&lt;br /&gt;       {&lt;br /&gt;           $atributos .= ' name="' . htmlentities($nombre) . '"';&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   $out = '&amp;lt;select';&lt;br /&gt;   if (is_array($atributos))&lt;br /&gt;   {&lt;br /&gt;       foreach ($atributos as $atributo_nombre =&amp;gt; $atributo_valor)&lt;br /&gt;       {&lt;br /&gt;           $out .= ' ' . $atributo_nombre . '="' . htmlentities($atributo_valor) . '"';&lt;br /&gt;       }&lt;br /&gt;   } else&lt;br /&gt;   {&lt;br /&gt;       $out .= ' ' . $atributos;&lt;br /&gt;   }&lt;br /&gt;   $out .= '&amp;gt;';&lt;br /&gt;   foreach ((array)$valores as $valor_clave =&amp;gt; $valor_etiqueta)&lt;br /&gt;   {&lt;br /&gt;       $out .= '&amp;lt;option value="' . htmlentities($valor_clave) . '"' . ($valor_clave == $seleccionado || (is_array($seleccionado) &amp;amp;&amp;amp; in_array($valor_clave,$seleccionado)) ? 'selected="selected"' : '') . '&amp;gt;' . htmlentities($valor_etiqueta) . '&amp;lt;/option&amp;gt;';&lt;br /&gt;   }&lt;br /&gt;   return $out . '&amp;lt;/select&amp;gt;';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo select('select',array('a' =&amp;gt; 'A', 'b' =&amp;gt; 'B','c' =&amp;gt; 'C','d' =&amp;gt; 'D'),array('a'),array('id' =&amp;gt; 'select', 'multiple' =&amp;gt; 'multiple'));&lt;br /&gt;echo PHP_EOL;&lt;br /&gt;echo select('select',array('a' =&amp;gt; 'A', 'b' =&amp;gt; 'B','c' =&amp;gt; 'C','d' =&amp;gt; 'D'),'a','id="select"');&lt;br /&gt;echo PHP_EOL;&lt;br /&gt;echo select('select');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8343887534116532241?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8343887534116532241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8343887534116532241&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8343887534116532241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8343887534116532241'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/10/flexible-parameters-hard-returns.html' title='Flexible parameters, hard returns'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-845161979376928719</id><published>2007-09-30T11:14:00.000-03:00</published><updated>2007-09-30T11:52:19.633-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='Good customs'/><title type='text'>Form processing</title><content type='html'>Always, the greater problem, is to process sent data. We are going to make a pursuit of which things are necessary to review for each form. As a previous notion, we must consider that all the data that client sends (POST, GET, COOKIE) is unreliable.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Review the permission of the user&lt;/span&gt;&lt;br /&gt;All the users do not have permissions for all the forms, that is clear. It is necessary to establish if the user can send that form or no, or if only he can do it partly.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Validate all the data&lt;/span&gt;&lt;br /&gt;It means that by each form, it is necessary to establish conditions. In general, the text fields must have a maximum length (normal it is to establish it according to the data base) or fixed (for example, the credit cards codes). Also it is necessary to review the format (usually for the email directions). There are data that only can be numerical, or dates that can not be valid.&lt;br /&gt;Checkbox, radio buttons and dropdowns have a range of prefixed options and they are not possible to left it.&lt;br /&gt;All these things it is necessary to have them in account, because an erroneous data can cause that information lost, but can be avoided if him force to the user to correct that error.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Save data&lt;/span&gt;&lt;br /&gt;Depending the destiny on the entered data, it is necessary to save the data of the form that corresponds. In general, we are going to keep them in databases, reason why the functions *_escape_string provide a form easy to escape the data according to the type of database that we use.&lt;br /&gt;In this point, it is necessary to have well-taken care of with the “magic quotes” (magic_quotes_gpc), that if they are enabled can cause the data doubly escaped. The best thing is to clear the quotes, if this config is in On.&lt;br /&gt;So why don't we forget to escape data, if we have magic_quotes_gpc?&lt;br /&gt;The idea of magic_quotes was not to have to escape data, and to facilitate the task to the programmer. The problem of this function, is that it escapes data in an arbitrate way and without considering in where they are used such.&lt;br /&gt;Another possible error is to want to keep data that the user did not submit, but to have magic_quotes_gpc On we did not escape, incorrectly.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Save the results&lt;/span&gt;&lt;br /&gt;The data are valid, and prepared… The only thing that is is to save it, and to make any other process that is necessary.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Show the results&lt;/span&gt;&lt;br /&gt;Still our work did not finish. The information that we kept, probably we want it to show somebody. In this point it is very important to escape the data again. Previously we kept it as the user submitted it, but at the time of showing it in a page, it is necessary to avoid malisiosa information. In general, to escape HTML entities is enough for this, but it would be better to escape all the entities, “even more rare” to display the information correctly.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;These 5 points are necessary for most of the data processing. It seems troublesome and complicated, but it is not it as much.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-845161979376928719?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/845161979376928719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=845161979376928719&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/845161979376928719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/845161979376928719'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/form-processing.html' title='Form processing'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8101695284071326581</id><published>2007-09-25T22:24:00.000-03:00</published><updated>2007-09-25T22:31:21.732-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Conexión por IP</title><content type='html'>Recently I discovered that is faster to connect to a server used its IP that its name. For example, instead of mysql_connect(“localhost”); one can use mysql_connect(“127.0.0.1”); and it ends up improving the speed of connection. A small optimization, but frequent.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8101695284071326581?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8101695284071326581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8101695284071326581&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8101695284071326581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8101695284071326581'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/conexin-por-ip.html' title='Conexión por IP'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-771712717520098921</id><published>2007-09-23T11:56:00.000-03:00</published><updated>2007-09-23T11:58:12.396-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Storing array elements in a variable</title><content type='html'>The other day, called the attention to read that is slower to accede to an array element than to a variable. I decided to prove whatever is the difference, and if it is worth the trouble. My conclusion is that the difference exists and if is called more than 10 times to the same index, can be worth the trouble to create a variable for that, but is also only recommendable to do it within a function, in a “scope” so that it is not all along in the memory.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://neonetsi.com.ar/seppo/desarrollophp/guardar-elementos-de-array-en-una-variable.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-771712717520098921?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://neonetsi.com.ar/seppo/desarrollophp/guardar-elementos-de-array-en-una-variable.php' title='Storing array elements in a variable'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/771712717520098921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=771712717520098921&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/771712717520098921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/771712717520098921'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/storing-array-elements-in-variable.html' title='Storing array elements in a variable'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-3132049570031919412</id><published>2007-09-20T01:06:00.000-03:00</published><updated>2007-09-20T01:12:40.119-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good customs'/><title type='text'>Reading the manual</title><content type='html'>I must read the manual&lt;br /&gt;I must read the manual&lt;br /&gt;I must read the manual&lt;br /&gt;I must read the manual&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yeah, it is boring, but it is necessary to consider that PHP has many functions that one perhaps ignores and we can avoid us to rediscover the wheel.&lt;br /&gt;Also it is necessary to read the commentaries of the users, many holes are covered there.&lt;br /&gt;&lt;br /&gt;The last function I discover: &lt;a href="http://www.php.net/manual/en/function.dl.php"&gt;dl&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-3132049570031919412?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/3132049570031919412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=3132049570031919412&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3132049570031919412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3132049570031919412'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/i-must-read-manual.html' title='Reading the manual'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-8768737832814133351</id><published>2007-09-16T15:45:00.000-03:00</published><updated>2007-09-16T15:48:03.086-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><category scheme='http://www.blogger.com/atom/ns#' term='Iteration'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Iterate over array</title><content type='html'>&lt;div id="result_box" dir="ltr"&gt;Perhaps it sounds repeated to the for - while post, but now instead of executing a code N times, I want to run all the positions of an array. Which is the most advisable way?&lt;br /&gt;In the first place, we have the optimized for.&lt;br /&gt;On the other hand, we can use foreach, that exactly crosses the array of data.&lt;br /&gt;A last alternative is to be crossing the array using its internal pointer.&lt;br /&gt;&lt;br /&gt;In this case, the best alternative is foreach, specially dedicated for this.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/recorrer-un-array.php"&gt;View example&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-8768737832814133351?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/recorrer-un-array.php' title='Iterate over array'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/8768737832814133351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=8768737832814133351&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8768737832814133351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/8768737832814133351'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/iterate-over-array.html' title='Iterate over array'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-3700801438032867057</id><published>2007-09-13T17:04:00.000-03:00</published><updated>2007-09-13T17:09:47.378-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good customs'/><title type='text'>Post or Get</title><content type='html'>Which is the criteria to choose if a form must go by Post or Get?&lt;br /&gt;W3c gives us a &lt;a href="http://www.w3.org/2001/tag/doc/whenToUseGet.html#checklist"&gt;list&lt;/a&gt; to decide. We are going to use that list as it bases, and to try to extend it a bit&lt;br /&gt;&lt;br /&gt;GET&lt;br /&gt;&lt;br /&gt;    * W3C: The interaction is more like a question (?)&lt;br /&gt;    * It is a data that is used as guide for the presentation&lt;br /&gt;    * It is wanted to be able to offer the possibility of copying and pasting to keep it, enter it in a page, to pass it to it to another person&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;POST&lt;br /&gt;&lt;br /&gt;    * W3C:  The interaction is more like an order&lt;br /&gt;    * W3C: The interaction changes the state of the resource in a way that   the user would perceive&lt;br /&gt;    * W3C: The user be held accountable for the results of the interaction&lt;br /&gt;    * Rebound second of the W3C like very important: to try to maintain the processings of forms like Post&lt;br /&gt;    * It handles “sensible” data like passwords&lt;br /&gt;    * The information is much (the amount of characters of URI can be limited pro the servant)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BOTH&lt;br /&gt;&lt;br /&gt;    * When data are processed, it is moral convention to make Post/Redirect/Get&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-3700801438032867057?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/3700801438032867057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=3700801438032867057&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3700801438032867057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3700801438032867057'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/post-or-get.html' title='Post or Get'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-4597556652009101781</id><published>2007-09-11T18:24:00.000-03:00</published><updated>2007-09-11T18:32:53.246-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good customs'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Error reporting</title><content type='html'>One does not program correctly, if errors exist. And if these errors escape of our sight, it will be more difficult to detect them and to correct them. An error that does not cause negative consequences, continues being an error. Commonest, in this sense, it is to verify the value of variables that are not initialized, or we do not know if they are it… If we proved the difference between&lt;br /&gt;&lt;br /&gt;1) if ($variable)&lt;br /&gt;2) if (isset ($variable))&lt;br /&gt;3) if (! empty ($variable))&lt;br /&gt;&lt;br /&gt;The first that calls to me attention is the more slow is the first option, if the variable is not defined, but is variable is defined is the more fast that empty and that isset, with which if he is sure that the variable exists, this is the best solution, but before the doubt he is preferable to use empty/isset.&lt;br /&gt;&lt;br /&gt;Returning to the subject of the errors, whenever it is codified is good for seeing the errors, therefore always it is good for executing&lt;br /&gt;&lt;br /&gt;error_reporting (E_ALL);&lt;br /&gt;&lt;br /&gt;while it is being developed, and to reduce the level to E_NONE when he is in a site live, or to eliminate error_display&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/reporte-de-errores.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-4597556652009101781?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/reporte-de-errores.php' title='Error reporting'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/4597556652009101781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=4597556652009101781&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/4597556652009101781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/4597556652009101781'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/error-reporting.html' title='Error reporting'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-3295694565477880704</id><published>2007-09-09T11:23:00.000-03:00</published><updated>2007-09-09T11:54:48.213-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Files'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Listing directories</title><content type='html'>The necessity to look for all the archives in a folder is common. The common way is to use opendir, but the function glob approaches to us alongside dark side of the force, offering us a simpler alternative… Nevertheless, this solution is slower.&lt;br /&gt;Another alternative is the function to dir, that returns a directory object, a more “elegant” solution if it is wanted, but is not more than wrapper of the same, reason why it is not faster.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/listar-directorio.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-3295694565477880704?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/listar-directorio.php' title='Listing directories'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/3295694565477880704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=3295694565477880704&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3295694565477880704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3295694565477880704'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/listing-directories.html' title='Listing directories'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-2486406475215003518</id><published>2007-09-08T12:54:00.000-03:00</published><updated>2007-09-08T12:57:20.336-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Function'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Avoid double functions calls</title><content type='html'>I was thinking that I can take any function and optimize it by storing results already calculated in a temporary variable.&lt;br /&gt;Therefore, I took common mathematical formula, the “quadratic one” that is used to obtain the roots of a polynomial of degree two, and began to prove forms to improve it.&lt;br /&gt;&lt;br /&gt;Several were the attempts, and the conclusion at which I arrived is that although he is better to store results of calls of functions, is not the best thing to keep it from operating simpler like the multiplication.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/evitar-dobles-llamados-a-funciones.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-2486406475215003518?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/evitar-dobles-llamados-a-funciones.php' title='Avoid double functions calls'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/2486406475215003518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=2486406475215003518&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2486406475215003518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/2486406475215003518'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/avoid-double-functions-calls.html' title='Avoid double functions calls'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-3759811349507859810</id><published>2007-09-08T12:49:00.000-03:00</published><updated>2007-09-08T12:54:07.421-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Integer'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>Pair or odd</title><content type='html'>How can we know if an integer number is pair or odd?&lt;br /&gt;Of course, it is not too hard.&lt;br /&gt;When I was just starting, I remembered I have looked for a way to do this, not too practical&lt;br /&gt;&lt;br /&gt;floor($a / 2) == $a / 2;&lt;br /&gt;&lt;br /&gt;The result is correct, but it can be much easier knowing the % operator&lt;br /&gt;&lt;br /&gt;$a % 2 == 0;&lt;br /&gt;&lt;br /&gt;However, you can still do it faster, but not necessarily easier, checking if the binary contains the 1 or not.&lt;br /&gt;&lt;br /&gt;$a &amp;amp; 1 == 0&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/par-o-impar.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-3759811349507859810?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/par-o-impar.php' title='Pair or odd'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/3759811349507859810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=3759811349507859810&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3759811349507859810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3759811349507859810'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/pair-or-odd.html' title='Pair or odd'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-27195188770522624</id><published>2007-09-08T12:42:00.001-03:00</published><updated>2007-09-08T12:53:45.787-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>str_replace - strtr</title><content type='html'>This two functions are too similar. Usually, str_replace is more famous, but which one is better? Let's try...&lt;br /&gt;&lt;br /&gt;str_replace('e','a','hello world');&lt;br /&gt;strtr('hello world','e','a');&lt;br /&gt;&lt;br /&gt;Let's compare a simple replace. In this comparison, str_replace takes a point.&lt;br /&gt;&lt;br /&gt;What happens if it is wanted to replace a text that is not?&lt;br /&gt;Both functions are quicker, but str_replace still more optimal. At this instance, it seems this options is better, but both functions allows multiple replacements at a time. Let's try it.&lt;br /&gt;&lt;br /&gt;str_replace(array('o','e'),'a','hello world');&lt;br /&gt;strtr('hello world',array('o' =&gt; 'a','e' =&gt; 'a'));&lt;br /&gt;&lt;br /&gt;Here we reeplace "o" and "e" for "a", and str_replace still likes better... Let's give strtr a las chance&lt;br /&gt;&lt;br /&gt;str_replace(array('o','e'),array('i','o'),'hello world');&lt;br /&gt;strtr('hello world',array('o' =&gt; 'i','e' =&gt; 'o'));&lt;br /&gt;&lt;br /&gt;In this case, the replacements are 'o' for 'i', and 'e' for 'a', and surprisely strtr takes the victory.&lt;br /&gt;&lt;br /&gt;Conclusion: usually, its preferable to use str_replace, but when you want to replace many characters for many others characters (and not only a value) strtr is better.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/str_replace-strtr.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-27195188770522624?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/str_replace-strtr.php' title='str_replace - strtr'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/27195188770522624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=27195188770522624&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/27195188770522624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/27195188770522624'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/strreplace-strtr.html' title='str_replace - strtr'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-6697059081795471709</id><published>2007-09-08T12:42:00.000-03:00</published><updated>2007-09-08T12:42:16.394-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good customs'/><title type='text'>Naming variables</title><content type='html'>It is important that our code can be read, by ourself or by others, so it is very likely to name of our vars explain what they contain.&lt;br /&gt;Personally, I don't like to include the data type in the variable name, but what it mean.&lt;br /&gt;As an usual exception to this rule you have the variables with no real sense, but useful, for example&lt;br /&gt;&lt;br /&gt;for ($i = 0; $i &lt; N; $i++) {&lt;br /&gt;  for ($j = 0; $j &lt; M; $j++) {&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-6697059081795471709?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/6697059081795471709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=6697059081795471709&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6697059081795471709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/6697059081795471709'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/naming-variables.html' title='Naming variables'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8117294483406544790.post-3707644254616876478</id><published>2007-09-08T12:35:00.000-03:00</published><updated>2007-09-20T01:04:42.689-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Iteration'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimization'/><title type='text'>for - while</title><content type='html'>Usually, to iterate a code N times you do&lt;br /&gt;&lt;br /&gt;for ($a = 0; $a &lt; N; $a++) {&lt;br /&gt;&lt;br /&gt;but, thinking a bit, this code can be optimized, because the second and third sentence can be joined, so we get this&lt;br /&gt;&lt;br /&gt;for ($a = -1; ++$a &lt; N;) {&lt;br /&gt;&lt;br /&gt;Also, you can think it in this way&lt;br /&gt;&lt;br /&gt;$a = 0;&lt;br /&gt;while (++$a &lt; N) {&lt;br /&gt;&lt;br /&gt;but the previous approach seems (a bit) better, in the practice.  This optimization can improve not much your code, we have to keep in mind this is one of the most common iterations, and you can repeat it a lot along your work.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neonetsi.com.ar/seppo/desarrollophp/for-while.php"&gt;View example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8117294483406544790-3707644254616876478?l=phpdeveloping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.neonetsi.com.ar/seppo/desarrollophp/for-while.php' title='for - while'/><link rel='replies' type='application/atom+xml' href='http://phpdeveloping.blogspot.com/feeds/3707644254616876478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8117294483406544790&amp;postID=3707644254616876478&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3707644254616876478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8117294483406544790/posts/default/3707644254616876478'/><link rel='alternate' type='text/html' href='http://phpdeveloping.blogspot.com/2007/09/for-while.html' title='for - while'/><author><name>seppo0010</name><uri>http://www.blogger.com/profile/02504022684566719870</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/-MZycJmm2nSM/TcRjh31LGOI/AAAAAAAAAEM/-VPfMm21vQo/s220/avatar.png'/></author><thr:total>0</thr:total></entry></feed>
