<?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-2865552588131115943</id><updated>2011-11-27T16:00:44.639-08:00</updated><category term='zend certified engineer'/><category term='PHP'/><category term='Self-XSS'/><category term='ZCE'/><category term='facebook attack'/><category term='php certification'/><category term='self xss'/><title type='text'>PHP free e-books, free codes, free scripts, free downloads</title><subtitle type='html'>PHP Teacher Powers PHP to the future...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://php-teacher.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-1259377335506891054</id><published>2011-11-16T21:51:00.000-08:00</published><updated>2011-11-16T22:14:27.815-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Self-XSS'/><category scheme='http://www.blogger.com/atom/ns#' term='self xss'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook attack'/><title type='text'>What is Self-XSS attack</title><content type='html'>Recently hackers attacked facebook by injecting porn images and videos in to the users account.Facebook said, it is a Self-XSS attack.&lt;br /&gt;&lt;br /&gt;The Self XSS attack is a computer securtiy vulnerability, mostly used to attack the web applications by injecting client side script (Java Script, VB Script etc..) into web pages viewed by other users.&lt;br /&gt;&lt;br /&gt;The below examples will be giving an overall idea about how a client side script can inject,&lt;br /&gt;&lt;br /&gt;For example enter the code into the web browser&lt;br /&gt;&lt;br /&gt;&lt;b&gt;javascript:alert('I am XSS');&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is will show a pop up with "I am XSS".&lt;br /&gt;&lt;br /&gt;Like this a hacker can inject malicious codes into the browser to steal confidential data, cookies, redirect to other sites etc...&lt;br /&gt;&lt;br /&gt;To get all the cookies informations, execute the below code in the browser&lt;br /&gt;&lt;br /&gt;&lt;b&gt;javascript:alert("Cookies:"+document.cookies+"  "+"\n I am XSS");&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The above codes would not be doing other than displaying the datas, but a hacker can&lt;br /&gt;inject powerfull malicious codes to destroy the user informations.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download PDF:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1) &lt;a href="http://www.virusbtn.com/pdf/conference_slides/2011/Revilla-Sandilands-VB2011.pdf" target="_blank"&gt;A Study of Malicious Attacks on Facebook&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) &lt;a href="http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf" target="_blank"&gt;http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3) &lt;a href="http://www.cis.syr.edu/~wedu/seed/Labs/Attacks_XSS/XSS.pdf" target="_blank"&gt;Cross-Site Scripting XSS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4) &lt;a href="http://sun.cs.ucdavis.edu/papers/esorics09_xssworm.pdf" target="_blank"&gt;http://sun.cs.ucdavis.edu/papers/esorics09_xssworm.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-1259377335506891054?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1259377335506891054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1259377335506891054'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2011/11/what-is-self-xss-attack.html' title='What is Self-XSS attack'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-5693995834978379117</id><published>2011-11-16T04:46:00.000-08:00</published><updated>2011-11-16T22:06:17.438-08:00</updated><title type='text'>ViewVC or ViewCVS</title><content type='html'>It was calling as ViewCVS, but it got changed to ViewVC.The open source tool is giving an browser interface to view the contents of SVN and CVS.&lt;br /&gt;This generates HTML to present directory, revision and logs. ViewVC is written in python and the parameters can be modified directly in a URL by using a REST style interface.&lt;br /&gt;&lt;br /&gt;The below items are some of the additional features of ViewVC:&lt;br /&gt;&lt;br /&gt;Support for filesystem-accessible CVS and Subversion repositories.&lt;br /&gt;Support for path-based authorization, including parsing and honoring Subversion authz configuration files.&lt;br /&gt;RSS feed generation for tracking changes to repositories or individual items within repositories.&lt;br /&gt;Individually configurable virtual host support.&lt;br /&gt;Line-based annotation/blame display.&lt;br /&gt;Revision graph capabilities (via integration with CvsGraph) (CVS only).&lt;br /&gt;Syntax highlighting support.&lt;br /&gt;Bonsai-like repository query facilities.&lt;br /&gt;Template-driven output generation.&lt;br /&gt;Colorized, side-by-side differences.&lt;br /&gt;Tarball generation (by tag/branch for CVS, by revision for Subversion).&lt;br /&gt;Localization support based on the Accept-Language request header.&lt;br /&gt;Ability to run either as CGI script or as a standalone server.&lt;br /&gt;Regexp-based file searching.&lt;br /&gt;INI-like configuration file (as opposed to requiring actual code tweaks)&lt;br /&gt;&lt;br /&gt;The authentication and auhtorization can be set while accessing the repositories using ViewVC.&lt;br /&gt;But the question is how can we restrict individual users to access their CVS or SVN repositories.&lt;br /&gt;&lt;br /&gt;The below URLs gives an ideas:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.viewvc.org/faq.html#authz-support" target="_blank"&gt;http://www.viewvc.org/faq.html#authz-support&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://svn-access-mana.sourceforge.net/#inst_web_viewvc" target="_blank"&gt;http://svn-access-mana.sourceforge.net/#inst_web_viewvc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download PDFs:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1) &lt;a href="http://svnbook.red-bean.com/en/1.5/svn-book.pdf" target="_blank"&gt;http://svnbook.red-bean.com/en/1.5/svn-book.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) &lt;a href="http://micro.stanford.edu/mediawiki/images/0/04/Howto_istall_SVN_Fedora.pdf" target="_blank"&gt;http://micro.stanford.edu/mediawiki/images/0/04/Howto_istall_SVN_Fedora.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3) &lt;a href="http://www.docbook.org/docs/howto/howto.pdf" target="_blank"&gt;http://www.docbook.org/docs/howto/howto.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4) &lt;a href="http://www.shrubbery.net/rancid/RhysEvans_overview_0.3.pdf"&gt;http://www.shrubbery.net/rancid/RhysEvans_overview_0.3.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5) &lt;a href="http://micro.stanford.edu/mediawiki/images/9/9b/Howto_istall_SVN_CentOS.pdf" target="_blank"&gt;http://micro.stanford.edu/mediawiki/images/9/9b/Howto_istall_SVN_CentOS.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;6) &lt;a href="http://wsmoak.net/subversion/demo/viewvc.html" target="_blank"&gt;http://wsmoak.net/subversion/demo/viewvc.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;7) &lt;a href="http://en.wikipedia.org/wiki/ViewVC" target="_blank"&gt;http://en.wikipedia.org/wiki/ViewVC&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-5693995834978379117?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5693995834978379117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5693995834978379117'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2011/11/viewvc.html' title='ViewVC or ViewCVS'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-2303847712600402224</id><published>2011-11-15T00:48:00.000-08:00</published><updated>2011-11-16T01:35:54.166-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ZCE'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='php certification'/><category scheme='http://www.blogger.com/atom/ns#' term='zend certified engineer'/><title type='text'>Advantages of Becoming a PHP Zend Certified Engineer - ZCE</title><content type='html'>ZCE is the #1 php certification available in the market.&lt;br /&gt;The certified person gets a good profile weightage.&lt;br /&gt;&lt;br /&gt;1) Differentiate yourself from other job seekers&lt;br /&gt;2) Increases your value while salary review&lt;br /&gt;3) Easily shortlisted your CV/Resume&lt;br /&gt;4) Gets a good recognition from the employer&lt;br /&gt;5) Lists in the Zens's PHP Yellow pages&lt;br /&gt;   &lt;a href="http://www.zend.com/en/store/education/certification/yellow-pages.php" target="_blank"&gt;http://www.zend.com/en/store/education/certification/yellow-pages.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Nearly 70 questions will be asked for the ZCE exam.&lt;br /&gt;The questions will be picked up randomly.There will be multiple type questions as well as the description type questions.&lt;br /&gt;&lt;br /&gt;Nearly one month of thorough training or self study is needed for the exam.&lt;br /&gt;The below links are very much useful for the beginners.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.zend.com/en/services/certification/" target="_blank"&gt;http://www.zend.com/en/services/certification/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.zend.com/en/services/training/course-catalog/certification" target="_blank"&gt;http://www.zend.com/en/services/training/course-catalog/certification&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Visit the URL to get the exam topics &lt;a href="http://www.zend.com/en/services/certification/php-5-certification/" target="_blank"&gt;http://www.zend.com/en/services/certification/php-5-certification/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-2303847712600402224?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/2303847712600402224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/2303847712600402224'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2011/11/zce-certification.html' title='Advantages of Becoming a PHP Zend Certified Engineer - ZCE'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-6346078877957574678</id><published>2008-11-06T07:57:00.000-08:00</published><updated>2008-11-06T07:59:37.635-08:00</updated><title type='text'>Using session in PHP</title><content type='html'>Keeping in mind the fact that Internet is a stateless platform and every request for a web page is treated as unique, there is a serious need of a tool to maintain the state. Otherwise, it will be a messy situation to keep track of requests made by a particular user. The good news is that use of PHP session serves the solution to this problem. This session variable is of great importance for web applications like shopping carts and is considered as equivalent to cookies, other significant way of maintaining the state.&lt;br /&gt;&lt;br /&gt;What Is PHP Session Capable Of&lt;br /&gt;&lt;br /&gt;PHP session is capable of storing the information in the form of session variables, in order to handle the ever-increasing traffic on a website. For instance, consider a shopping website, with products scattered in different categories and different pages. In such a situation, a user may switch from one page t another and keep on adding products from different pages to his or her shopping cart.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-6346078877957574678?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/6346078877957574678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/6346078877957574678'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/11/using-session-in-php.html' title='Using session in PHP'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-2275600408986693965</id><published>2008-11-06T07:54:00.000-08:00</published><updated>2008-11-06T07:57:25.922-08:00</updated><title type='text'>Memcache</title><content type='html'>Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications.&lt;br /&gt;&lt;br /&gt;The Memcache module also provides a session handler (memcache).&lt;br /&gt;&lt;br /&gt;More information about memcached can be found at » http://www.danga.com/memcached/.&lt;br /&gt;&lt;br /&gt;Below is one example&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;$memcache = new Memcache;&lt;br /&gt;$memcache-&gt;connect('localhost', 11211) or die ("Could not connect");&lt;br /&gt;&lt;br /&gt;$version = $memcache-&gt;getVersion();&lt;br /&gt;echo "Server's version: ".$version."&lt;br/&gt;\n";&lt;br /&gt;&lt;br /&gt;$tmp_object = new stdClass;&lt;br /&gt;$tmp_object-&gt;str_attr = 'test';&lt;br /&gt;$tmp_object-&gt;int_attr = 123;&lt;br /&gt;&lt;br /&gt;$memcache-&gt;set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");&lt;br /&gt;echo "Store data in the cache (data will expire in 10 seconds)&lt;br/&gt;\n";&lt;br /&gt;&lt;br /&gt;$get_result = $memcache-&gt;get('key');&lt;br /&gt;echo "Data from the cache:&lt;br/&gt;\n";&lt;br /&gt;&lt;br /&gt;var_dump($get_result);&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/2865552588131115943-2275600408986693965?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/2275600408986693965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/2275600408986693965'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/11/memcache.html' title='Memcache'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-3883789768568875762</id><published>2008-05-30T21:40:00.000-07:00</published><updated>2008-05-30T21:42:39.058-07:00</updated><title type='text'>PHP Design Patterns</title><content type='html'>Patterns are ways to describe best practices and good designs. They show a flexible solution to common programming problems.&lt;br /&gt;&lt;br /&gt;    * Factory Patterns:     The Factory pattern allows for the instantiation of objects at runtime. It is called a Factory Pattern since it is responsible for "manufacturing" an object. A Parameterized Factory receives the name of the class to instantiate as argument.&lt;br /&gt;&lt;br /&gt;    * Singleton Patterns:     The Singleton pattern applies to situations in which there needs to be a single instance of a class. The most common example of this is a database connection. Implementing this pattern allows a programmer to make this single instance easily accessible by many other objects.&lt;br /&gt; i got this good stuff from a newly coming website on PHP, http://www.e-php.info&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-3883789768568875762?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/3883789768568875762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/3883789768568875762'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/05/php-design-patterns.html' title='PHP Design Patterns'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-4891618596734335389</id><published>2008-05-24T22:30:00.000-07:00</published><updated>2008-05-24T22:33:23.417-07:00</updated><title type='text'>metaphone — Calculate the metaphone key of a string</title><content type='html'>Description&lt;br /&gt;string metaphone ( string $str [, int $phones ] )&lt;br /&gt;&lt;br /&gt;Calculates the metaphone key of str .&lt;br /&gt;&lt;br /&gt;Similar to soundex() metaphone creates the same key for similar sounding words. It's more accurate than soundex() as it knows the basic rules of English pronunciation. The metaphone generated keys are of variable length.&lt;br /&gt;&lt;br /&gt;Metaphone was developed by Lawrence Philips &lt;lphilips at verity dot com&gt;. It is described in ["Practical Algorithms for Programmers", Binstock &amp; Rex, Addison Wesley, 1995].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-4891618596734335389?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4891618596734335389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4891618596734335389'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/05/metaphone-calculate-metaphone-key-of.html' title='metaphone — Calculate the metaphone key of a string'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-8118392546920994059</id><published>2008-05-24T22:24:00.000-07:00</published><updated>2008-05-24T22:29:11.675-07:00</updated><title type='text'>quotemeta — Quote meta characters</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis dc-description"&gt;    &lt;span class="type"&gt;string&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;quotemeta&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$str&lt;/tt&gt;&lt;/span&gt;    )&lt;/div&gt;    &lt;p class="para rdfs-comment"&gt;    Returns a version of str with a backslash character (&lt;i&gt;\&lt;/i&gt;)    before every character that is among these:     &lt;/p&gt;&lt;div class="example-contents"&gt;&lt;pre&gt;. \ + * ? [ ^ ] ( $ )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  Returns the string with meta characters quoted.&lt;br /&gt;&lt;span class="simpara"&gt;This function is&lt;br /&gt;binary-safe.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;     &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-8118392546920994059?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/8118392546920994059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/8118392546920994059'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/05/quotemeta-quote-meta-characters.html' title='quotemeta — Quote meta characters'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-21014531649365938</id><published>2008-05-24T22:10:00.000-07:00</published><updated>2008-05-24T22:11:53.859-07:00</updated><title type='text'>parse_str — Parses the string into variables</title><content type='html'>&lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;dl&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;str&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;       &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        The input string.       &lt;/p&gt;      &lt;/dd&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;arr&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;       &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        If the second parameter &lt;i&gt;&lt;tt class="parameter"&gt;arr&lt;/tt&gt;&lt;/i&gt;  is present,        variables are stored in this variable as array elements instead.       &lt;/p&gt;      &lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;&lt;span class="type"&gt;&lt;span class="type void"&gt;&lt;br /&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;parse_str&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$str&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;array&lt;/span&gt; &lt;tt class="parameter reference"&gt;&amp;amp;$arr&lt;/tt&gt;&lt;/span&gt;   ] )&lt;br /&gt;&lt;br /&gt;   No value is returned.&lt;br /&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;$str &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"first=value&amp;amp;arr[]=foo+bar&amp;amp;arr[]=baz"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;parse_str&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$str&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$first&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;  &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// value&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$arr&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;]; &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// foo bar&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$arr&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;]; &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// baz&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;parse_str&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$str&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$output&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$output&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'first'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;];  &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// value&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$output&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'arr'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;]; &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// foo bar&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$output&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'arr'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;]; &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// baz&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-21014531649365938?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/21014531649365938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/21014531649365938'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/05/parsestr-parses-string-into-variables.html' title='parse_str — Parses the string into variables'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-3045394629005339773</id><published>2008-05-24T22:04:00.000-07:00</published><updated>2008-05-24T22:09:11.484-07:00</updated><title type='text'>sha1 — Calculate the sha1 hash of a string</title><content type='html'>&lt;div class="example-contents"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;sha1&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$str&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;bool&lt;/span&gt; &lt;tt class="parameter"&gt;$raw_output&lt;/tt&gt;&lt;/span&gt;   ] )&lt;br /&gt;   Returns the sha1 hash as a string.&lt;br /&gt;&lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;$str &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'apple'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;sha1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$str&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) === &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'d0be2dc421be4fcd0172e5afceea3970e2f3d940'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;    echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"Would you like a green or red apple?"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;    exit;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-3045394629005339773?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/3045394629005339773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/3045394629005339773'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/05/sha1-calculate-sha1-hash-of-string.html' title='sha1 — Calculate the sha1 hash of a string'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-1970081864412527184</id><published>2008-02-21T09:29:00.002-08:00</published><updated>2008-02-21T09:30:14.844-08:00</updated><title type='text'>array_values — Return all the values of an array</title><content type='html'>&lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;array&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;array_values&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;array&lt;/span&gt; &lt;tt class="parameter"&gt;$input&lt;/tt&gt;&lt;/span&gt;    )&lt;/div&gt;    &lt;p class="para"&gt;    &lt;b&gt;array_values()&lt;/b&gt; returns all the values from the    &lt;i&gt;&lt;tt class="parameter"&gt;input&lt;/tt&gt;&lt;/i&gt;  array and indexes numerically the    array.   &lt;/p&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;div class="example"&gt;     &lt;p&gt;&lt;b&gt;Example#1 &lt;b&gt;array_values()&lt;/b&gt; example&lt;/b&gt;&lt;/p&gt;     &lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;$array &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"size" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"XL"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"color" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"gold"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;print_r&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;array_values&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$array&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div class="example-contents"&gt;&lt;p&gt;The above example will output:&lt;/p&gt;&lt;/div&gt;     &lt;div class="example-contents"&gt;&lt;pre&gt;&lt;div class="cdata"&gt;&lt;pre&gt;Array&lt;br /&gt;(&lt;br /&gt;   [0] =&gt; XL&lt;br /&gt;   [1] =&gt; gold&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;   &lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-1970081864412527184?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1970081864412527184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1970081864412527184'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/arrayvalues-return-all-values-of-array.html' title='array_values — Return all the values of an array'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-8314675696565708246</id><published>2008-02-21T09:29:00.001-08:00</published><updated>2008-02-21T09:29:34.823-08:00</updated><title type='text'>array_flip — Exchanges all keys with their associated values in an array</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;array&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;array_flip&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;array&lt;/span&gt; &lt;tt class="parameter"&gt;$trans&lt;/tt&gt;&lt;/span&gt;    )&lt;/div&gt;    &lt;p class="para"&gt;    &lt;b&gt;array_flip()&lt;/b&gt; returns an &lt;a href="http://in.php.net/manual/en/language.types.array.php" class="type array"&gt;array&lt;/a&gt; in flip    order, i.e. keys from &lt;i&gt;&lt;tt class="parameter"&gt;trans&lt;/tt&gt;&lt;/i&gt;  become values and values    from &lt;i&gt;&lt;tt class="parameter"&gt;trans&lt;/tt&gt;&lt;/i&gt;  become keys.   &lt;/p&gt;   &lt;p class="para"&gt;    Note that the values of &lt;i&gt;&lt;tt class="parameter"&gt;trans&lt;/tt&gt;&lt;/i&gt;  need to be valid    keys, i.e. they need to be either &lt;a href="http://in.php.net/manual/en/language.types.integer.php" class="type integer"&gt;integer&lt;/a&gt; or    &lt;a href="http://in.php.net/manual/en/language.types.string.php" class="type string"&gt;string&lt;/a&gt;. A warning will be emitted if a value has the wrong    type, and the key/value pair in question &lt;em class="emphasis"&gt;will not be    flipped&lt;/em&gt;.   &lt;/p&gt;   &lt;p class="para"&gt;    If a value has several occurrences, the latest key will be    used as its values, and all others will be lost.   &lt;/p&gt;  &lt;/div&gt;    &lt;div class="refsect1 parameters"&gt;   &lt;h3 class="title"&gt;Parameters&lt;/h3&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;trans&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        An array of key/value pairs to be flipped.       &lt;/p&gt;      &lt;/dd&gt;&lt;/dl&gt;      &lt;/div&gt;    &lt;div class="refsect1 returnvalues"&gt;   &lt;h3 class="title"&gt;Return Values&lt;/h3&gt;   &lt;p class="para"&gt;    Returns the flipped array on success and &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; on failure.   &lt;/p&gt;  &lt;/div&gt;    &lt;div class="refsect1 examples"&gt;   &lt;h3 class="title"&gt;Examples&lt;/h3&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;div class="example"&gt;     &lt;p&gt;&lt;b&gt;Example#1 &lt;b&gt;array_flip()&lt;/b&gt; example&lt;/b&gt;&lt;/p&gt;     &lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;$trans &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;array_flip&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$trans&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$original &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;strtr&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$str&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$trans&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;     &lt;/div&gt;      &lt;p class="para"&gt;    &lt;/p&gt;&lt;div class="example"&gt;     &lt;p&gt;&lt;b&gt;Example#2 &lt;b&gt;array_flip()&lt;/b&gt; example : collision&lt;/b&gt;&lt;/p&gt;     &lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;$trans &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"a" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"b" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"c" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$trans &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;array_flip&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$trans&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;print_r&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$trans&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div class="example-contents"&gt;&lt;p&gt;      now &lt;var class="varname"&gt;$trans&lt;/var&gt; is:     &lt;/p&gt;&lt;/div&gt;     &lt;div class="example-contents"&gt;&lt;pre&gt;&lt;div class="cdata"&gt;&lt;pre&gt;Array&lt;br /&gt;(&lt;br /&gt;   [1] =&gt; b&lt;br /&gt;   [2] =&gt; c&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;   &lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;     &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-8314675696565708246?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/8314675696565708246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/8314675696565708246'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/arrayflip-exchanges-all-keys-with-their.html' title='array_flip — Exchanges all keys with their associated values in an array'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-4315889389842874072</id><published>2008-02-21T09:26:00.000-08:00</published><updated>2008-02-21T09:28:58.364-08:00</updated><title type='text'>array_walk — Apply a user function to every member of an array</title><content type='html'>&lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;bool&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;array_walk&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;array&lt;/span&gt; &lt;tt class="parameter reference"&gt;&amp;amp;$array&lt;/tt&gt;&lt;/span&gt;    , &lt;span class="methodparam"&gt;&lt;span class="type"&gt;callback&lt;/span&gt; &lt;tt class="parameter"&gt;$funcname&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;mixed&lt;/span&gt; &lt;tt class="parameter"&gt;$userdata&lt;/tt&gt;&lt;/span&gt;   ] )&lt;/div&gt;    &lt;p class="simpara"&gt;    Returns &lt;b&gt;&lt;tt&gt;TRUE&lt;/tt&gt;&lt;/b&gt; on success or &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; on failure.   &lt;/p&gt;   &lt;p class="simpara"&gt;    Applies the user-defined function &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt;  to each    element of the &lt;i&gt;&lt;tt class="parameter"&gt;array&lt;/tt&gt;&lt;/i&gt;  array. Typically,    &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt;  takes on two parameters.    The &lt;i&gt;&lt;tt class="parameter"&gt;array&lt;/tt&gt;&lt;/i&gt;  parameter's value being the first, and    the key/index second. If the optional &lt;i&gt;&lt;tt class="parameter"&gt;userdata&lt;/tt&gt;&lt;/i&gt;     parameter is supplied, it will be passed as the third parameter to    the callback &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt; .   &lt;/p&gt;   &lt;p class="simpara"&gt;    If function &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt;  requires more parameters than    given to it, an error of level &lt;a href="http://in.php.net/manual/en/ref.errorfunc.php#errorfunc.constants" class="link"&gt;    E_WARNING&lt;/a&gt; will be generated each time &lt;b&gt;array_walk()&lt;/b&gt;    calls &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt; . These warnings may be suppressed by    prepending the PHP error operator    &lt;a href="http://in.php.net/manual/en/language.operators.errorcontrol.php" class="link"&gt;@&lt;/a&gt; to the    &lt;b&gt;array_walk()&lt;/b&gt; call, or by using    &lt;a href="http://in.php.net/manual/en/function.error-reporting.php" class="function"&gt;error_reporting()&lt;/a&gt;.   &lt;/p&gt;   &lt;blockquote&gt;&lt;p&gt;&lt;b class="note"&gt;Note&lt;/b&gt;:          If &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt;  needs to be working with the     actual values of the array, specify the first parameter of     &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt;  as a     &lt;a href="http://in.php.net/manual/en/language.references.php" class="link"&gt;reference&lt;/a&gt;. Then,     any changes made to those elements will be made in the     original array itself.   &lt;br /&gt;  &lt;/p&gt;&lt;/blockquote&gt;   &lt;blockquote&gt;&lt;p&gt;&lt;b class="note"&gt;Note&lt;/b&gt;:          Passing the key and userdata to &lt;i&gt;&lt;tt class="parameter"&gt;funcname&lt;/tt&gt;&lt;/i&gt;  was     added in 4.0.0   &lt;br /&gt;  &lt;/p&gt;&lt;/blockquote&gt;   &lt;p class="para"&gt;    &lt;b&gt;array_walk()&lt;/b&gt; is not affected by the internal    array pointer of &lt;i&gt;&lt;tt class="parameter"&gt;array&lt;/tt&gt;&lt;/i&gt; .  &lt;b&gt;    array_walk()&lt;/b&gt; will walk through the entire array    regardless of pointer position.   &lt;/p&gt;   &lt;p class="para"&gt;    Users may not change the array itself from the callback    function. e.g. Add/delete elements, unset elements, etc.  If    the array that &lt;b&gt;array_walk()&lt;/b&gt; is applied to    is changed, the behavior of this function is undefined, and    unpredictable.   &lt;/p&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;div class="example"&gt;     &lt;p&gt;&lt;b&gt;Example#1 &lt;b&gt;array_walk()&lt;/b&gt; example&lt;/b&gt;&lt;/p&gt;     &lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;$fruits &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"d" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"lemon"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"a" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"orange"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"b" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"banana"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"c" &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"apple"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;test_alter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&amp;amp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$item1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$key&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$prefix&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)&lt;br /&gt;{&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$item1 &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"$prefix: $item1"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;test_print&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$item2&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$key&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)&lt;br /&gt;{&lt;br /&gt;    echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"$key. $item2&lt;br /&gt;\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"Before ...:\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;array_walk&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$fruits&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'test_print'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;array_walk&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$fruits&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'test_alter'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'fruit'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"... and after:\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;array_walk&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$fruits&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'test_print'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div class="example-contents"&gt;&lt;p&gt;The above example will output:&lt;/p&gt;&lt;/div&gt;     &lt;div class="example-contents"&gt;&lt;pre&gt;&lt;div class="cdata"&gt;&lt;pre&gt;Before ...:&lt;br /&gt;d. lemon&lt;br /&gt;a. orange&lt;br /&gt;b. banana&lt;br /&gt;c. apple&lt;br /&gt;... and after:&lt;br /&gt;d. fruit: lemon&lt;br /&gt;a. fruit: orange&lt;br /&gt;b. fruit: banana&lt;br /&gt;c. fruit: apple&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;   &lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-4315889389842874072?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4315889389842874072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4315889389842874072'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/arraywalk-apply-user-function-to-every.html' title='array_walk — Apply a user function to every member of an array'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-7988674884962844484</id><published>2008-02-20T09:38:00.000-08:00</published><updated>2008-02-20T09:39:05.386-08:00</updated><title type='text'>readfile — Outputs a file</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;int&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;readfile&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$filename&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;bool&lt;/span&gt; &lt;tt class="parameter"&gt;$use_include_path&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;resource&lt;/span&gt; &lt;tt class="parameter"&gt;$context&lt;/tt&gt;&lt;/span&gt;   ]] )&lt;/div&gt;    &lt;p class="para"&gt;    Reads a file and writes it to the output buffer.   &lt;/p&gt;  &lt;/div&gt;    &lt;div class="refsect1 parameters"&gt;   &lt;h3 class="title"&gt;Parameters&lt;/h3&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;filename&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        The filename being read.       &lt;/p&gt;      &lt;/dd&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;use_include_path&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        You can use the optional second parameter and set it to &lt;b&gt;&lt;tt&gt;TRUE&lt;/tt&gt;&lt;/b&gt;, if        you want to search for the file in the &lt;a href="http://in2.php.net/manual/en/ini.core.php#ini.include-path" class="link"&gt;include_path&lt;/a&gt;, too.       &lt;/p&gt;      &lt;/dd&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;context&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        A context stream &lt;a href="http://in2.php.net/manual/en/language.types.resource.php" class="type resource"&gt;resource&lt;/a&gt;.       &lt;/p&gt;      &lt;/dd&gt;&lt;/dl&gt;      &lt;/div&gt;     &lt;div class="refsect1 returnvalues"&gt;   &lt;h3 class="title"&gt;Return Values&lt;/h3&gt;   &lt;p class="para"&gt;    Returns the number of bytes read from the file. If an error    occurs, &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; is returned and unless the function was called as    @&lt;b&gt;readfile()&lt;/b&gt;, an error message is printed.   &lt;/p&gt; &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="html"&gt;&lt;span class="default"&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;session_cache_limiter&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;'none'&lt;/span&gt;&lt;span class="keyword"&gt;); &lt;/span&gt;&lt;span class="comment"&gt;//*Use before session_start()&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;session_start&lt;/span&gt;&lt;span class="keyword"&gt;();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;$file &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="string"&gt;'ASDFGgg.pdf'&lt;/span&gt;&lt;span class="keyword"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;_Download&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;"files_dir/"&lt;/span&gt;&lt;span class="keyword"&gt;.&lt;/span&gt;&lt;span class="default"&gt;$file&lt;/span&gt;&lt;span class="keyword"&gt;, &lt;/span&gt;&lt;span class="default"&gt;$file&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;&lt;br /&gt;function &lt;/span&gt;&lt;span class="default"&gt;_Download&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$f_location&lt;/span&gt;&lt;span class="keyword"&gt;,&lt;/span&gt;&lt;span class="default"&gt;$f_name&lt;/span&gt;&lt;span class="keyword"&gt;){&lt;br /&gt;     &lt;/span&gt;&lt;span class="default"&gt;header &lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;"Cache-Control: must-revalidate, post-check=0, pre-check=0"&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;    &lt;/span&gt;&lt;span class="default"&gt;header&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;'Content-Description: File Transfer'&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;    &lt;/span&gt;&lt;span class="default"&gt;header&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;'Content-Type: application/octet-stream'&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;    &lt;/span&gt;&lt;span class="default"&gt;header&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;'Content-Length: ' &lt;/span&gt;&lt;span class="keyword"&gt;. &lt;/span&gt;&lt;span class="default"&gt;filesize&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$f_location&lt;/span&gt;&lt;span class="keyword"&gt;));&lt;br /&gt;    &lt;/span&gt;&lt;span class="default"&gt;header&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;'Content-Disposition: attachment; filename=' &lt;/span&gt;&lt;span class="keyword"&gt;. &lt;/span&gt;&lt;span class="default"&gt;basename&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$f_name&lt;/span&gt;&lt;span class="keyword"&gt;));&lt;br /&gt;    &lt;/span&gt;&lt;span class="default"&gt;readfile&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$f_location&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&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/2865552588131115943-7988674884962844484?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/7988674884962844484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/7988674884962844484'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/readfile-outputs-file.html' title='readfile — Outputs a file'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-3593741623135596857</id><published>2008-02-20T09:37:00.000-08:00</published><updated>2008-02-20T09:38:19.514-08:00</updated><title type='text'>is_uploaded_file — Tells whether the file was uploaded via HTTP POST</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;bool&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;is_uploaded_file&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$filename&lt;/tt&gt;&lt;/span&gt;    )&lt;/div&gt;    &lt;p class="para"&gt;    Returns &lt;b&gt;&lt;tt&gt;TRUE&lt;/tt&gt;&lt;/b&gt; if the file named by &lt;i&gt;&lt;tt class="parameter"&gt;filename&lt;/tt&gt;&lt;/i&gt;  was    uploaded via HTTP POST. This is useful to help ensure that a    malicious user hasn't tried to trick the script into working on    files upon which it should not be working--for instance,    &lt;var class="filename"&gt;/etc/passwd&lt;/var&gt;.   &lt;/p&gt;   &lt;p class="para"&gt;    This sort of check is especially important if there is any chance    that anything done with uploaded files could reveal their    contents to the user, or even to other users on the same    system.   &lt;/p&gt;   &lt;p class="para"&gt;    For proper working, the function &lt;b&gt;is_uploaded_file()&lt;/b&gt; needs    an argument like $_FILES['userfile']['tmp_name'], - the name of the uploaded    file on the clients machine $_FILES['userfile']['name'] does not work.   &lt;/p&gt;  &lt;/div&gt;    &lt;div class="refsect1 parameters"&gt;   &lt;h3 class="title"&gt;Parameters&lt;/h3&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;filename&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        The filename being checked.       &lt;/p&gt;      &lt;/dd&gt;&lt;/dl&gt;      &lt;/div&gt;    &lt;div class="refsect1 returnvalues"&gt;   &lt;h3 class="title"&gt;Return Values&lt;/h3&gt;   &lt;p class="para"&gt;    Returns &lt;b&gt;&lt;tt&gt;TRUE&lt;/tt&gt;&lt;/b&gt; on success or &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; on failure.   &lt;/p&gt; &lt;br /&gt;&lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;is_uploaded_file&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_FILES&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'userfile'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tmp_name'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;])) {&lt;br /&gt;   echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"File "&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_FILES&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'userfile'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'name'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] .&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;" uploaded successfully.\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;   echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"Displaying contents\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;readfile&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_FILES&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'userfile'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tmp_name'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;]);&lt;br /&gt;} else {&lt;br /&gt;   echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"Possible file upload attack: "&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;   echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"filename '"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_FILES&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'userfile'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tmp_name'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"'."&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&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/2865552588131115943-3593741623135596857?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/3593741623135596857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/3593741623135596857'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/isuploadedfile-tells-whether-file-was.html' title='is_uploaded_file — Tells whether the file was uploaded via HTTP POST'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-2218734352007959444</id><published>2008-02-20T09:36:00.000-08:00</published><updated>2008-02-20T09:37:26.217-08:00</updated><title type='text'>move_uploaded_file — Moves an uploaded file to a new location</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;bool&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;move_uploaded_file&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$filename&lt;/tt&gt;&lt;/span&gt;    , &lt;span class="methodparam"&gt;&lt;span class="type"&gt;string&lt;/span&gt; &lt;tt class="parameter"&gt;$destination&lt;/tt&gt;&lt;/span&gt;    )&lt;/div&gt;    &lt;p class="para"&gt;    This function checks to ensure that the file designated by    &lt;i&gt;&lt;tt class="parameter"&gt;filename&lt;/tt&gt;&lt;/i&gt;  is a valid upload file (meaning    that it was uploaded via PHP's HTTP POST upload mechanism). If    the file is valid, it will be moved to the filename given by    &lt;i&gt;&lt;tt class="parameter"&gt;destination&lt;/tt&gt;&lt;/i&gt; .   &lt;/p&gt;   &lt;p class="para"&gt;    This sort of check is especially important if there is any chance    that anything done with uploaded files could reveal their    contents to the user, or even to other users on the same    system.   &lt;/p&gt;  &lt;/div&gt;    &lt;div class="refsect1 parameters"&gt;   &lt;h3 class="title"&gt;Parameters&lt;/h3&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;filename&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        The filename of the uploaded file.       &lt;/p&gt;      &lt;/dd&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;destination&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        The destination of the moved file.       &lt;/p&gt;      &lt;/dd&gt;&lt;/dl&gt;      &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-2218734352007959444?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/2218734352007959444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/2218734352007959444'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/moveuploadedfile-moves-uploaded-file-to.html' title='move_uploaded_file — Moves an uploaded file to a new location'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-1936689136527171793</id><published>2008-02-20T09:34:00.000-08:00</published><updated>2008-02-20T09:35:29.138-08:00</updated><title type='text'>ob_end_flush — Flush (send) the output buffer and turn off output buffering</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;bool&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;ob_end_flush&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ( &lt;span class="methodparam"&gt;void&lt;/span&gt;    )&lt;/div&gt;    &lt;p class="para"&gt;    This function will send the contents of the topmost output buffer (if    any) and turn this output buffer off.  If you want to further    process the buffer's contents you have to call    &lt;a href="http://in2.php.net/manual/en/function.ob-get-contents.php" class="function"&gt;ob_get_contents()&lt;/a&gt; before    &lt;b&gt;ob_end_flush()&lt;/b&gt; as the buffer contents are    discarded after &lt;b&gt;ob_end_flush()&lt;/b&gt; is called.   &lt;/p&gt;   &lt;blockquote&gt;&lt;p&gt;&lt;b class="note"&gt;Note&lt;/b&gt;:     &lt;span class="simpara"&gt;     This function is similar to &lt;a href="http://in2.php.net/manual/en/function.ob-get-flush.php" class="function"&gt;ob_get_flush()&lt;/a&gt;, except     that &lt;a href="http://in2.php.net/manual/en/function.ob-get-flush.php" class="function"&gt;ob_get_flush()&lt;/a&gt; returns the buffer as a string.    &lt;/span&gt;   &lt;/p&gt;&lt;/blockquote&gt;  &lt;/div&gt;    &lt;div class="refsect1 returnvalues"&gt;   &lt;h3 class="title"&gt;Return Values&lt;/h3&gt;   &lt;p class="para"&gt;    Returns &lt;b&gt;&lt;tt&gt;TRUE&lt;/tt&gt;&lt;/b&gt; on success or &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; on failure. Reasons for failure are first that you called the    function without an active buffer or that for some reason a buffer could    not be deleted (possible for special buffer).   &lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-1936689136527171793?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1936689136527171793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1936689136527171793'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/obendflush-flush-send-output-buffer-and.html' title='ob_end_flush — Flush (send) the output buffer and turn off output buffering'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-755430606441627649</id><published>2008-02-20T09:32:00.000-08:00</published><updated>2008-02-20T09:34:12.616-08:00</updated><title type='text'>ob_start — Turn on output buffering</title><content type='html'>&lt;div class="refsect1 description"&gt;   &lt;h3 class="title"&gt;Description&lt;/h3&gt;   &lt;div class="methodsynopsis"&gt;    &lt;span class="type"&gt;bool&lt;/span&gt; &lt;span class="methodname"&gt;&lt;b&gt;&lt;b&gt;ob_start&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;     ([ &lt;span class="methodparam"&gt;&lt;span class="type"&gt;callback&lt;/span&gt; &lt;tt class="parameter"&gt;$output_callback&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;int&lt;/span&gt; &lt;tt class="parameter"&gt;$chunk_size&lt;/tt&gt;&lt;/span&gt;    [, &lt;span class="methodparam"&gt;&lt;span class="type"&gt;bool&lt;/span&gt; &lt;tt class="parameter"&gt;$erase&lt;/tt&gt;&lt;/span&gt;   ]]] )&lt;/div&gt;    &lt;p class="para"&gt;    This function will turn output buffering on. While output buffering is    active no output is sent from the script (other than headers), instead the    output is stored in an internal buffer.   &lt;/p&gt;   &lt;p class="para"&gt;    The contents of this internal buffer may be copied into a string variable    using &lt;a href="http://in2.php.net/manual/en/function.ob-get-contents.php" class="function"&gt;ob_get_contents()&lt;/a&gt;.  To output what is stored in    the internal buffer, use &lt;a href="http://in2.php.net/manual/en/function.ob-end-flush.php" class="function"&gt;ob_end_flush()&lt;/a&gt;. Alternatively,    &lt;a href="http://in2.php.net/manual/en/function.ob-end-clean.php" class="function"&gt;ob_end_clean()&lt;/a&gt; will silently discard the buffer    contents.   &lt;/p&gt;   &lt;div class="warning"&gt;&lt;b class="warning"&gt;Warning&lt;/b&gt;    &lt;p class="para"&gt;     Some web servers (e.g. Apache) change the working directory of a script     when calling the callback function. You can change it back by e.g.     &lt;i class="literal"&gt;chdir(dirname($_SERVER['SCRIPT_FILENAME']))&lt;/i&gt; in the     callback function.    &lt;/p&gt;   &lt;/div&gt;   &lt;p class="para"&gt;    Output buffers are stackable, that is, you may call    &lt;b&gt;ob_start()&lt;/b&gt; while another    &lt;b&gt;ob_start()&lt;/b&gt; is active. Just make    sure that you call &lt;a href="http://in2.php.net/manual/en/function.ob-end-flush.php" class="function"&gt;ob_end_flush()&lt;/a&gt;    the appropriate number of times. If multiple output callback    functions are active, output is being filtered sequentially    through each of them in nesting order.   &lt;/p&gt;  &lt;/div&gt;       &lt;h3 class="title"&gt;Parameters&lt;/h3&gt;   &lt;p class="para"&gt;    &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;output_callback&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        An optional &lt;i&gt;&lt;tt class="parameter"&gt;output_callback&lt;/tt&gt;&lt;/i&gt;  function may be        specified. This function takes a string as a parameter and should        return a string. The function will be called when        &lt;a href="http://in2.php.net/manual/en/function.ob-end-flush.php" class="function"&gt;ob_end_flush()&lt;/a&gt; is called, or when the output buffer        is flushed to the browser at the end of the request.  When        &lt;i&gt;&lt;tt class="parameter"&gt;output_callback&lt;/tt&gt;&lt;/i&gt;  is called, it will receive the        contents of the output buffer as its parameter and is expected to        return a new output buffer as a result, which will be sent to the        browser. If the &lt;i&gt;&lt;tt class="parameter"&gt;output_callback&lt;/tt&gt;&lt;/i&gt;  is not a        callable function, this function will return &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt;.       &lt;/p&gt;       &lt;p class="para"&gt;        If the callback function has two parameters, the second parameter is        filled with a bit-field consisting of        &lt;b&gt;&lt;tt&gt;PHP_OUTPUT_HANDLER_START&lt;/tt&gt;&lt;/b&gt;,        &lt;b&gt;&lt;tt&gt;PHP_OUTPUT_HANDLER_CONT&lt;/tt&gt;&lt;/b&gt; and        &lt;b&gt;&lt;tt&gt;PHP_OUTPUT_HANDLER_END&lt;/tt&gt;&lt;/b&gt;.       &lt;/p&gt;       &lt;p class="para"&gt;        If &lt;i&gt;&lt;tt class="parameter"&gt;output_callback&lt;/tt&gt;&lt;/i&gt;  returns &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; original        input is sent to the browser.       &lt;/p&gt;       &lt;p class="para"&gt;        The &lt;i&gt;&lt;tt class="parameter"&gt;output_callback&lt;/tt&gt;&lt;/i&gt;  parameter may be bypassed        by passing a &lt;b&gt;&lt;tt&gt;NULL&lt;/tt&gt;&lt;/b&gt; value.       &lt;/p&gt;       &lt;p class="para"&gt;        &lt;a href="http://in2.php.net/manual/en/function.ob-end-clean.php" class="function"&gt;ob_end_clean()&lt;/a&gt;, &lt;a href="http://in2.php.net/manual/en/function.ob-end-flush.php" class="function"&gt;ob_end_flush()&lt;/a&gt;,        &lt;a href="http://in2.php.net/manual/en/function.ob-clean.php" class="function"&gt;ob_clean()&lt;/a&gt;, &lt;a href="http://in2.php.net/manual/en/function.ob-flush.php" class="function"&gt;ob_flush()&lt;/a&gt; and        &lt;b&gt;ob_start()&lt;/b&gt; may not be called from a callback        function. If you call them from callback function, the behavior is        undefined. If you would like to delete the contents of a buffer,        return "" (a null string) from callback function.        You can't even call functions using the output buffering functions like        &lt;i class="literal"&gt;print_r($expression, true)&lt;/i&gt; or        &lt;i class="literal"&gt;highlight_file($filename, true)&lt;/i&gt; from a callback        function.       &lt;/p&gt;       &lt;blockquote&gt;&lt;p&gt;&lt;b class="note"&gt;Note&lt;/b&gt;:                  In PHP 4.0.4, &lt;a href="http://in2.php.net/manual/en/function.ob-gzhandler.php" class="function"&gt;ob_gzhandler()&lt;/a&gt; was introduced to         facilitate sending gz-encoded data to web browsers that support         compressed web pages.  &lt;a href="http://in2.php.net/manual/en/function.ob-gzhandler.php" class="function"&gt;ob_gzhandler()&lt;/a&gt; determines         what type of content encoding the browser will accept and will return         its output accordingly.       &lt;br /&gt;      &lt;/p&gt;&lt;/blockquote&gt;      &lt;/dd&gt;&lt;dt&gt;       &lt;span class="term"&gt;&lt;i&gt;&lt;tt class="parameter"&gt;chunk_size&lt;/tt&gt;&lt;/i&gt; &lt;/span&gt;      &lt;/dt&gt;&lt;dd&gt;        &lt;p class="para"&gt;        If the optional parameter &lt;i&gt;&lt;tt class="parameter"&gt;chunk_size&lt;/tt&gt;&lt;/i&gt;  is passed, the        buffer will be flushed after any output call which causes the buffer's        length to equal or exceed &lt;i&gt;&lt;tt class="parameter"&gt;chunk_size&lt;/tt&gt;&lt;/i&gt; .        Default value 0 means that the function is called only in the end,        other special value 1 sets &lt;i&gt;&lt;tt class="parameter"&gt;chunk_size&lt;/tt&gt;&lt;/i&gt;  to 4096.       &lt;/p&gt;      &lt;/dd&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-755430606441627649?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/755430606441627649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/755430606441627649'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/obstart-turn-on-output-buffering.html' title='ob_start — Turn on output buffering'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-5753834897563424450</id><published>2008-02-19T09:07:00.000-08:00</published><updated>2008-02-19T09:10:15.640-08:00</updated><title type='text'>md5 — Calculate the md5 hash of a string</title><content type='html'>Calculates the MD5 hash of str using the &lt;a class="link external" href="http://www.faqs.org/rfcs/rfc1321"&gt;» RSA Data Security, Inc. MD5 Message-Digest Algorithm&lt;/a&gt;, and returns that hash.&lt;br /&gt;&lt;?php$str = 'apple';&lt;br /&gt;if ((md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {  &lt;br /&gt; echo "Would you like a green or red apple?";    exit;}&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-5753834897563424450?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5753834897563424450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5753834897563424450'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2008/02/md5-calculate-md5-hash-of-string.html' title='md5 — Calculate the md5 hash of a string'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-386391598958563477</id><published>2007-10-24T18:37:00.001-07:00</published><updated>2007-10-24T18:37:45.180-07:00</updated><title type='text'>serialize — Generates a storable representation of a value</title><content type='html'>string &lt;b&gt;serialize&lt;/b&gt; ( mixed $value )&lt;br /&gt;&lt;p&gt;    Generates a storable representation of a value   &lt;/p&gt;&lt;p&gt;    This is useful for storing or passing PHP values around without    losing their type and structure.   &lt;/p&gt;&lt;p&gt;    To make the serialized string into a PHP value again, use    &lt;a href="http://in2.php.net/manual/en/function.unserialize.php"&gt;unserialize()&lt;/a&gt;.     &lt;/p&gt;&lt;h2&gt;Parameters&lt;/h2&gt;&lt;p&gt;    &lt;/p&gt;&lt;div class="variablelist"&gt;&lt;dl&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;value&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        The value to be serialized. &lt;b&gt;serialize()&lt;/b&gt;        handles all types, except the &lt;a href="http://in2.php.net/manual/en/language.types.resource.php"&gt;resource&lt;/a&gt;-type.        You can even &lt;b&gt;serialize()&lt;/b&gt; arrays that contain        references to itself. Circular references inside the array/object you         are &lt;b&gt;serialize()&lt;/b&gt;ing will also be stored. Any other         reference will be lost.       &lt;/p&gt;&lt;p&gt;        When serializing objects, PHP will attempt to call the member function        &lt;b&gt;__sleep()&lt;/b&gt; prior to serialization. This is to allow the        object to do any last minute clean-up, etc. prior to being serialized.        Likewise, when the object is restored using &lt;a href="http://in2.php.net/manual/en/function.unserialize.php"&gt;unserialize()&lt;/a&gt;        the &lt;b&gt;__wakeup()&lt;/b&gt; member function is called.       &lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;   &lt;h2&gt;Return Values&lt;/h2&gt;&lt;p&gt;    Returns a string containing a byte-stream representation of     &lt;i&gt;&lt;tt&gt;value&lt;/tt&gt;&lt;/i&gt; that can be stored anywhere.   &lt;/p&gt;&lt;h2&gt;Examples&lt;/h2&gt;&lt;p&gt;    &lt;/p&gt;&lt;div class="example"&gt;&lt;a name="id3750055"&gt;&lt;/a&gt;&lt;p&gt;&lt;b&gt;Example 2594. &lt;b&gt;serialize()&lt;/b&gt; example&lt;/b&gt;&lt;/p&gt;&lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span class="html"&gt; &lt;span class="default"&gt;&lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span class="comment"&gt;// $session_data contains a multi-dimensional array with session&lt;br /&gt;// information for the current user.  We use serialize() to store&lt;br /&gt;// it in a database at the end of the request.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;$conn &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="default"&gt;odbc_connect&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="string"&gt;"webdb"&lt;/span&gt;&lt;span class="keyword"&gt;, &lt;/span&gt;&lt;span class="string"&gt;"php"&lt;/span&gt;&lt;span class="keyword"&gt;, &lt;/span&gt;&lt;span class="string"&gt;"chicken"&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;$stmt &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="default"&gt;odbc_prepare&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$conn&lt;/span&gt;&lt;span class="keyword"&gt;,&lt;br /&gt;      &lt;/span&gt;&lt;span class="string"&gt;"UPDATE sessions SET data = ? WHERE id = ?"&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;$sqldata &lt;/span&gt;&lt;span class="keyword"&gt;= array (&lt;/span&gt;&lt;span class="default"&gt;serialize&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$session_data&lt;/span&gt;&lt;span class="keyword"&gt;), &lt;/span&gt;&lt;span class="default"&gt;$_SERVER&lt;/span&gt;&lt;span class="keyword"&gt;[&lt;/span&gt;&lt;span class="string"&gt;'PHP_AUTH_USER'&lt;/span&gt;&lt;span class="keyword"&gt;]);&lt;br /&gt;if (!&lt;/span&gt;&lt;span class="default"&gt;odbc_execute&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$stmt&lt;/span&gt;&lt;span class="keyword"&gt;, &amp;amp;&lt;/span&gt;&lt;span class="default"&gt;$sqldata&lt;/span&gt;&lt;span class="keyword"&gt;)) {&lt;br /&gt;    &lt;/span&gt;&lt;span class="default"&gt;$stmt &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="default"&gt;odbc_prepare&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$conn&lt;/span&gt;&lt;span class="keyword"&gt;,&lt;br /&gt;     &lt;/span&gt;&lt;span class="string"&gt;"INSERT INTO sessions (id, data) VALUES(?, ?)"&lt;/span&gt;&lt;span class="keyword"&gt;);&lt;br /&gt;    if (!&lt;/span&gt;&lt;span class="default"&gt;odbc_execute&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$stmt&lt;/span&gt;&lt;span class="keyword"&gt;, &amp;amp;&lt;/span&gt;&lt;span class="default"&gt;$sqldata&lt;/span&gt;&lt;span class="keyword"&gt;)) {&lt;br /&gt;        &lt;/span&gt;&lt;span class="comment"&gt;/* Something went wrong.. */&lt;br /&gt;    &lt;/span&gt;&lt;span class="keyword"&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-386391598958563477?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/386391598958563477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/386391598958563477'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/10/serialize-generates-storable.html' title='serialize — Generates a storable representation of a value'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-7767075230754828480</id><published>2007-10-24T18:36:00.001-07:00</published><updated>2007-10-24T18:36:42.509-07:00</updated><title type='text'>move_uploaded_file — Moves an uploaded file to a new location</title><content type='html'>bool &lt;b&gt;move_uploaded_file&lt;/b&gt; ( string $filename, string $destination )&lt;br /&gt;&lt;p&gt;    This function checks to ensure that the file designated by    &lt;i&gt;&lt;tt&gt;filename&lt;/tt&gt;&lt;/i&gt; is a valid upload file (meaning    that it was uploaded via PHP's HTTP POST upload mechanism). If    the file is valid, it will be moved to the filename given by    &lt;i&gt;&lt;tt&gt;destination&lt;/tt&gt;&lt;/i&gt;.   &lt;/p&gt;&lt;p&gt;    This sort of check is especially important if there is any chance    that anything done with uploaded files could reveal their    contents to the user, or even to other users on the same    system.   &lt;/p&gt;&lt;h2&gt;Parameters&lt;/h2&gt;&lt;p&gt;    &lt;/p&gt;&lt;div class="variablelist"&gt;&lt;dl&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;filename&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        The filename of the uploaded file.       &lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;destination&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        The destination of the moved file.       &lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;   &lt;h2&gt;Return Values&lt;/h2&gt;&lt;p&gt;    If &lt;i&gt;&lt;tt&gt;filename&lt;/tt&gt;&lt;/i&gt; is not a valid upload file,    then no action will occur, and    &lt;b&gt;move_uploaded_file()&lt;/b&gt; will return    &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt;.   &lt;/p&gt;&lt;p&gt;    If &lt;i&gt;&lt;tt&gt;filename&lt;/tt&gt;&lt;/i&gt; is a valid upload file, but    cannot be moved for some reason, no action will occur, and    &lt;b&gt;move_uploaded_file()&lt;/b&gt; will return    &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt;. Additionally, a warning will be issued.   &lt;/p&gt;&lt;h2&gt;Notes&lt;/h2&gt;&lt;blockquote&gt;&lt;p&gt;&lt;b&gt;Note: &lt;/b&gt;     &lt;b&gt;move_uploaded_file()&lt;/b&gt; is both &lt;a href="http://in2.php.net/manual/en/features.safe-mode.php#ini.safe-mode"&gt;safe mode&lt;/a&gt;     and &lt;a href="http://in2.php.net/manual/en/features.safe-mode.php#ini.open-basedir"&gt;open_basedir&lt;/a&gt;     aware. However, restrictions are placed only on the     &lt;i&gt;&lt;tt&gt;destination&lt;/tt&gt;&lt;/i&gt; path as to allow the moving     of uploaded files in which &lt;i&gt;&lt;tt&gt;filename&lt;/tt&gt;&lt;/i&gt; may conflict     with such restrictions. &lt;b&gt;move_uploaded_file()&lt;/b&gt; ensures     the safety of this operation by allowing only those files uploaded     through PHP to be moved.    &lt;/p&gt;&lt;/blockquote&gt;&lt;b class="warning"&gt;Warning&lt;/b&gt;&lt;p&gt;     If the destination file already exists, it will be overwritten.    &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-7767075230754828480?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/7767075230754828480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/7767075230754828480'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/10/moveuploadedfile-moves-uploaded-file-to.html' title='move_uploaded_file — Moves an uploaded file to a new location'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-8630750073634252889</id><published>2007-10-24T18:34:00.000-07:00</published><updated>2007-10-24T18:35:26.261-07:00</updated><title type='text'>basename — Returns filename component of path</title><content type='html'>string &lt;b&gt;basename&lt;/b&gt; ( string $path [, string $suffix] )&lt;br /&gt;&lt;p&gt;    Given a string containing a path to a file, this function will return the    base name of the file.       &lt;/p&gt;&lt;h2&gt;Parameters&lt;/h2&gt;&lt;p&gt;    &lt;/p&gt;&lt;div class="variablelist"&gt;&lt;dl&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;path&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        A path.       &lt;/p&gt;&lt;p&gt;        On Windows, both slash (&lt;var&gt;/&lt;/var&gt;) and backslash        (&lt;var&gt;\&lt;/var&gt;) are used as directory separator character. In        other environments, it is the forward slash (&lt;var&gt;/&lt;/var&gt;).       &lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;suffix&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        If the filename ends in &lt;i&gt;&lt;tt&gt;suffix&lt;/tt&gt;&lt;/i&gt; this will also        be cut off.       &lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;   &lt;h2&gt;Return Values&lt;/h2&gt;&lt;p&gt;    Returns the base name of the given &lt;i&gt;&lt;tt&gt;path&lt;/tt&gt;&lt;/i&gt;.&lt;br /&gt;&lt;/p&gt;&lt;div class="example-contents"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span class="html"&gt; &lt;span class="default"&gt;&lt;?php&lt;br /&gt;$path &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="string"&gt;"/home/httpd/html/index.php"&lt;/span&gt;&lt;span class="keyword"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;$file &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="default"&gt;basename&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$path&lt;/span&gt;&lt;span class="keyword"&gt;);         &lt;/span&gt;&lt;span class="comment"&gt;// $file is set to "index.php"&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;$file &lt;/span&gt;&lt;span class="keyword"&gt;= &lt;/span&gt;&lt;span class="default"&gt;basename&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$path&lt;/span&gt;&lt;span class="keyword"&gt;, &lt;/span&gt;&lt;span class="string"&gt;".php"&lt;/span&gt;&lt;span class="keyword"&gt;); &lt;/span&gt;&lt;span class="comment"&gt;// $file is set to "index"&lt;br /&gt;&lt;/span&gt;&lt;span class="default"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-8630750073634252889?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/8630750073634252889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/8630750073634252889'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/10/basename-returns-filename-component-of.html' title='basename — Returns filename component of path'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-6300121330482468396</id><published>2007-10-24T18:32:00.000-07:00</published><updated>2007-10-24T18:33:40.000-07:00</updated><title type='text'>glob-Find pathnames matching a pattern</title><content type='html'>array &lt;b&gt;glob&lt;/b&gt; ( string $pattern [, int $flags] )&lt;br /&gt;&lt;p&gt;    The &lt;b&gt;glob()&lt;/b&gt; function searches for all the pathnames    matching &lt;i&gt;&lt;tt&gt;pattern&lt;/tt&gt;&lt;/i&gt; according to the rules used by    the libc glob() function, which is similar to the rules used by common    shells.   &lt;/p&gt;&lt;h2&gt;Parameters&lt;/h2&gt;&lt;p&gt;    &lt;/p&gt;&lt;div class="variablelist"&gt;&lt;dl&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;pattern&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        The pattern. No tilde expansion or parameter substitution is done.       &lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;flags&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        Valid flags:        &lt;/p&gt;&lt;div class="itemizedlist"&gt;&lt;ul type="disc"&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_MARK&lt;/tt&gt;&lt;/b&gt; - Adds a slash to each item returned          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_NOSORT&lt;/tt&gt;&lt;/b&gt; - Return files as they appear in the           directory (no sorting)          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_NOCHECK&lt;/tt&gt;&lt;/b&gt; - Return the search pattern if no           files matching it were found          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_NOESCAPE&lt;/tt&gt;&lt;/b&gt; - Backslashes do not quote           metacharacters          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_BRACE&lt;/tt&gt;&lt;/b&gt; - Expands {a,b,c} to match 'a', 'b',           or 'c'          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_ONLYDIR&lt;/tt&gt;&lt;/b&gt; - Return only directory entries           which match the pattern          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_ERR&lt;/tt&gt;&lt;/b&gt; - Stop on read errors (like unreadable           directories), by default errors are ignored.          &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;       &lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;   &lt;h2&gt;Return Values&lt;/h2&gt;&lt;p&gt;    Returns an array containing the matched files/directories, an empty array    if no file matched or &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; on error.   &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-6300121330482468396?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/6300121330482468396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/6300121330482468396'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/10/glob-find-pathnames-matching-pattern.html' title='glob-Find pathnames matching a pattern'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-7160289336937294572</id><published>2007-09-09T08:16:00.000-07:00</published><updated>2007-09-09T08:17:20.852-07:00</updated><title type='text'>glob</title><content type='html'>&lt;p&gt;glob — Find pathnames matching a pattern&lt;/p&gt;&lt;h2&gt;Description&lt;/h2&gt;array &lt;b&gt;glob&lt;/b&gt; ( string $pattern [, int $flags] )&lt;br /&gt;&lt;p&gt;    The &lt;b&gt;glob()&lt;/b&gt; function searches for all the pathnames    matching &lt;i&gt;&lt;tt&gt;pattern&lt;/tt&gt;&lt;/i&gt; according to the rules used by    the libc glob() function, which is similar to the rules used by common    shells.   &lt;/p&gt;&lt;h2&gt;Parameters&lt;/h2&gt;&lt;p&gt;    &lt;/p&gt;&lt;div class="variablelist"&gt;&lt;dl&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;pattern&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        The pattern. No tilde expansion or parameter substitution is done.       &lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;span class="term"&gt;&lt;i&gt;&lt;tt&gt;flags&lt;/tt&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;        Valid flags:        &lt;/p&gt;&lt;div class="itemizedlist"&gt;&lt;ul type="disc"&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_MARK&lt;/tt&gt;&lt;/b&gt; - Adds a slash to each item returned          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_NOSORT&lt;/tt&gt;&lt;/b&gt; - Return files as they appear in the           directory (no sorting)          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_NOCHECK&lt;/tt&gt;&lt;/b&gt; - Return the search pattern if no           files matching it were found          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_NOESCAPE&lt;/tt&gt;&lt;/b&gt; - Backslashes do not quote           metacharacters          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_BRACE&lt;/tt&gt;&lt;/b&gt; - Expands {a,b,c} to match 'a', 'b',           or 'c'          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_ONLYDIR&lt;/tt&gt;&lt;/b&gt; - Return only directory entries           which match the pattern          &lt;/li&gt;&lt;li&gt;           &lt;b&gt;&lt;tt&gt;GLOB_ERR&lt;/tt&gt;&lt;/b&gt; - Stop on read errors (like unreadable           directories), by default errors are ignored.          &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;       &lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;   &lt;h2&gt;Return Values&lt;/h2&gt;&lt;p&gt;    Returns an array containing the matched files/directories, an empty array    if no file matched or &lt;b&gt;&lt;tt&gt;FALSE&lt;/tt&gt;&lt;/b&gt; on error.   &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-7160289336937294572?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/7160289336937294572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/7160289336937294572'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/09/glob.html' title='glob'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-1242250651508452334</id><published>2007-08-16T03:25:00.000-07:00</published><updated>2007-08-16T03:26:53.962-07:00</updated><title type='text'>ini_set()</title><content type='html'>string ini_set ( string $varname, string $newvalue )&lt;br /&gt;Sets the value of the given configuration option. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-1242250651508452334?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1242250651508452334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1242250651508452334'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/iniset.html' title='ini_set()'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-5764422694483596964</id><published>2007-08-16T03:22:00.002-07:00</published><updated>2007-08-16T03:23:42.164-07:00</updated><title type='text'>PHP Objects</title><content type='html'>Basic &lt;a title="Object-oriented programming" href="http://en.wikipedia.org/wiki/Object-oriented_programming"&gt;Object-oriented programming&lt;/a&gt; functionality was added in PHP 3. Handling of objects was completely rewritten for PHP 5, allowing for better performance and more features. In previous versions of PHP, objects were handled like &lt;a title="Primitive type" href="http://en.wikipedia.org/wiki/Primitive_type"&gt;primitive types&lt;/a&gt;. The drawback of this method was that the whole object was copied when a variable was assigned, or passed as a parameter to a method. In the new approach, objects are referenced by &lt;a title="Smart pointer" href="http://en.wikipedia.org/wiki/Smart_pointer#Handles"&gt;handle&lt;/a&gt;, and not by value. PHP 5 introduced private and protected &lt;a title="Member variable" href="http://en.wikipedia.org/wiki/Member_variable"&gt;member variables&lt;/a&gt; and methods, along with &lt;a title="Class (computer science)" href="http://en.wikipedia.org/wiki/Class_%28computer_science%29#Abstract_and_concrete_classes"&gt;abstract classes&lt;/a&gt; and &lt;a title="Abstract method" href="http://en.wikipedia.org/wiki/Abstract_method"&gt;abstract methods&lt;/a&gt;. It also introduced a standard way of declaring &lt;a title="Constructor (computer science)" href="http://en.wikipedia.org/wiki/Constructor_%28computer_science%29"&gt;constructors&lt;/a&gt; and &lt;a title="Destructor (computer science)" href="http://en.wikipedia.org/wiki/Destructor_%28computer_science%29"&gt;destructors&lt;/a&gt; similar to that of other object-oriented languages, such as C++, and an &lt;a title="Exception handling" href="http://en.wikipedia.org/wiki/Exception_handling"&gt;exception handling&lt;/a&gt; model similar to that of other programming languages.&lt;br /&gt;The static method and class variable features in Zend Engine 2 do not work the way some expect. There is no &lt;a title="Virtual table" href="http://en.wikipedia.org/wiki/Virtual_table"&gt;virtual table&lt;/a&gt; feature in the engine, so the &lt;a title="Static variable" href="http://en.wikipedia.org/wiki/Static_variable"&gt;static variables&lt;/a&gt; are bound with a name at compile time instead of with a reference.&lt;br /&gt;class foo extends bar&lt;br /&gt;{&lt;br /&gt;function __construct()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;public static function thisstaticfunc()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;The above very basic example shows how to define a class, foo, that inherits from class bar. Additionally, the function, mystaticfunc, is a public static function that is called with foo::thisstaticfunc();.&lt;br /&gt;If the developer asks to create a copy of an object by using the reserved word clone, the Zend engine will check if a __clone() method has been defined or not. If not, it will call a default __clone() which will copy all of the object's properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports all of the properties from the source object, so that they can start with a by-value &lt;a class="extiw" title="wiktionary:replica" href="http://en.wiktionary.org/wiki/replica"&gt;replica&lt;/a&gt; of the source object, and only override properties that need to be changed&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-5764422694483596964?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5764422694483596964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5764422694483596964'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/php-objects.html' title='PHP Objects'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-854324425976782392</id><published>2007-08-16T03:22:00.001-07:00</published><updated>2007-08-16T03:22:39.999-07:00</updated><title type='text'>PHP Data types</title><content type='html'>PHP stores whole numbers in a platform-dependent range. This range is typically that of 32-bit signed integers. Integer variables can be assigned using decimal (positive and negative), &lt;a title="Octal" href="http://en.wikipedia.org/wiki/Octal"&gt;octal&lt;/a&gt; and &lt;a title="Hexadecimal" href="http://en.wikipedia.org/wiki/Hexadecimal"&gt;hexadecimal&lt;/a&gt; notations. &lt;a title="Real numbers" href="http://en.wikipedia.org/wiki/Real_numbers"&gt;Real numbers&lt;/a&gt; are also stored in a platform-specific range. They can be specified using &lt;a title="Floating point" href="http://en.wikipedia.org/wiki/Floating_point"&gt;floating point&lt;/a&gt; notation, or two forms of &lt;a title="Scientific notation" href="http://en.wikipedia.org/wiki/Scientific_notation"&gt;scientific notation&lt;/a&gt;.&lt;br /&gt;PHP has a native &lt;a title="Boolean" href="http://en.wikipedia.org/wiki/Boolean"&gt;Boolean&lt;/a&gt; type, named "boolean", similar to the native Boolean types in &lt;a title="Java (programming language)" href="http://en.wikipedia.org/wiki/Java_%28programming_language%29"&gt;Java&lt;/a&gt; and &lt;a title="C++" href="http://en.wikipedia.org/wiki/C%2B%2B"&gt;C++&lt;/a&gt;. Using the Boolean type conversion rules, non-zero values can be interpreted as true and zero as false, as in Perl.&lt;br /&gt;The null data type represents a variable that has no value. The only value in the null data type is NULL.&lt;br /&gt;Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension. Examples include file, image and database resources.&lt;br /&gt;&lt;a title="Array" href="http://en.wikipedia.org/wiki/Array"&gt;Arrays&lt;/a&gt; support both numeric and string indices, and are &lt;a title="Heterogeneous" href="http://en.wikipedia.org/wiki/Heterogeneous"&gt;heterogeneous&lt;/a&gt;. Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in &lt;a title="Hash table" href="http://en.wikipedia.org/wiki/Hash_table"&gt;hashes&lt;/a&gt; with both keys and values, and the two can be intermingled&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-854324425976782392?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/854324425976782392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/854324425976782392'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/php-data-types.html' title='PHP Data types'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-4068011178444289330</id><published>2007-08-16T03:21:00.000-07:00</published><updated>2007-08-16T03:22:06.437-07:00</updated><title type='text'>PHP Command-line scripting</title><content type='html'>PHP also provides a &lt;a title="Command line interface" href="http://en.wikipedia.org/wiki/Command_line_interface"&gt;command line interface&lt;/a&gt; &lt;a title="Server Application Programming Interface" href="http://en.wikipedia.org/wiki/Server_Application_Programming_Interface"&gt;SAPI&lt;/a&gt; for developing shell and desktop applications, daemons, log parsing, or other system administration tasks. PHP is increasingly used on the command line for tasks that have traditionally been the domain of &lt;a title="Perl" href="http://en.wikipedia.org/wiki/Perl"&gt;Perl&lt;/a&gt;, &lt;a title="Python (programming language)" href="http://en.wikipedia.org/wiki/Python_%28programming_language%29"&gt;Python&lt;/a&gt;, &lt;a title="Awk" href="http://en.wikipedia.org/wiki/Awk"&gt;awk&lt;/a&gt;, or &lt;a title="Shell script" href="http://en.wikipedia.org/wiki/Shell_script"&gt;shell scripting&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-4068011178444289330?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4068011178444289330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4068011178444289330'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/php-command-line-scripting.html' title='PHP Command-line scripting'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-5382770820013062134</id><published>2007-08-16T03:20:00.002-07:00</published><updated>2007-08-16T03:21:36.207-07:00</updated><title type='text'>PHP Server-side scripting</title><content type='html'>Originally designed to create dynamic web pages, PHP's principal focus is &lt;a title="Server-side scripting" href="http://en.wikipedia.org/wiki/Server-side_scripting"&gt;server-side scripting&lt;/a&gt;. While running the PHP parser with a &lt;a title="Web server" href="http://en.wikipedia.org/wiki/Web_server"&gt;web server&lt;/a&gt; and &lt;a title="Web browser" href="http://en.wikipedia.org/wiki/Web_browser"&gt;web browser&lt;/a&gt;, the PHP model can be compared to other server-side scripting languages such as &lt;a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft"&gt;Microsoft&lt;/a&gt;'s &lt;a title="ASP.NET" href="http://en.wikipedia.org/wiki/ASP.NET"&gt;ASP.NET&lt;/a&gt; system, &lt;a title="Sun Microsystems" href="http://en.wikipedia.org/wiki/Sun_Microsystems"&gt;Sun Microsystems&lt;/a&gt;' &lt;a title="JavaServer Pages" href="http://en.wikipedia.org/wiki/JavaServer_Pages"&gt;JavaServer Pages&lt;/a&gt;, &lt;a title="Mod perl" href="http://en.wikipedia.org/wiki/Mod_perl"&gt;mod_perl&lt;/a&gt; and the &lt;a title="Ruby on Rails" href="http://en.wikipedia.org/wiki/Ruby_on_Rails"&gt;Ruby on Rails&lt;/a&gt; framework, as they all provide dynamic content to the &lt;a title="Client (computing)" href="http://en.wikipedia.org/wiki/Client_%28computing%29"&gt;client&lt;/a&gt; from a web server. To more directly compete with the "framework" approach taken by these systems, Zend is working on the &lt;a title="Zend Framework" href="http://en.wikipedia.org/wiki/Zend_Framework"&gt;Zend Framework&lt;/a&gt; - an emerging (as of June 2006) set of PHP building blocks and best practices; other &lt;a title="List of web application frameworks" href="http://en.wikipedia.org/wiki/List_of_web_application_frameworks"&gt;PHP frameworks&lt;/a&gt; along the same lines include &lt;a title="CakePHP" href="http://en.wikipedia.org/wiki/CakePHP"&gt;CakePHP&lt;/a&gt;, &lt;a title="PRADO" href="http://en.wikipedia.org/wiki/PRADO"&gt;PRADO&lt;/a&gt; and &lt;a title="Symfony" href="http://en.wikipedia.org/wiki/Symfony"&gt;Symfony&lt;/a&gt;.&lt;br /&gt;The &lt;a title="LAMP (software bundle)" href="http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29"&gt;LAMP&lt;/a&gt; architecture has become popular in the Web industry as a way of deploying inexpensive, reliable, scalable, secure web applications. PHP is commonly used as the P in this bundle alongside &lt;a title="Linux" href="http://en.wikipedia.org/wiki/Linux"&gt;Linux&lt;/a&gt;, &lt;a title="Apache HTTP Server" href="http://en.wikipedia.org/wiki/Apache_HTTP_Server"&gt;Apache&lt;/a&gt; and &lt;a title="MySQL" href="http://en.wikipedia.org/wiki/MySQL"&gt;MySQL&lt;/a&gt;, although the P can also refer to &lt;a title="Python (programming language)" href="http://en.wikipedia.org/wiki/Python_%28programming_language%29"&gt;Python&lt;/a&gt; or &lt;a title="Perl" href="http://en.wikipedia.org/wiki/Perl"&gt;Perl&lt;/a&gt;. PHP can be used with a large number of &lt;a title="Relational database management system" href="http://en.wikipedia.org/wiki/Relational_database_management_system"&gt;relational database management systems&lt;/a&gt;, runs on all of the most popular web servers and is available for many different &lt;a title="Operating system" href="http://en.wikipedia.org/wiki/Operating_system"&gt;operating systems&lt;/a&gt;. This flexibility means that PHP has a wide installation base across the Internet; over 19 million Internet domains are currently hosted on servers with PHP installed&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-5382770820013062134?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5382770820013062134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/5382770820013062134'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/php-server-side-scripting.html' title='PHP Server-side scripting'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-1507745043853695529</id><published>2007-08-16T03:20:00.001-07:00</published><updated>2007-08-16T03:20:53.218-07:00</updated><title type='text'>PHP Usage</title><content type='html'>PHP generally runs on a &lt;a title="Web server" href="http://en.wikipedia.org/wiki/Web_server"&gt;web server&lt;/a&gt;, taking PHP code as its input and creating Web pages as output. However, it can also be used for &lt;a title="Command-line" href="http://en.wikipedia.org/wiki/Command-line"&gt;command-line&lt;/a&gt; scripting and &lt;a title="Client-side" href="http://en.wikipedia.org/wiki/Client-side"&gt;client-side&lt;/a&gt; &lt;a title="Graphical user interface" href="http://en.wikipedia.org/wiki/Graphical_user_interface"&gt;GUI&lt;/a&gt; applications. PHP can be deployed on most &lt;a title="Web server" href="http://en.wikipedia.org/wiki/Web_server"&gt;web servers&lt;/a&gt; and on almost every &lt;a title="Operating system" href="http://en.wikipedia.org/wiki/Operating_system"&gt;operating system&lt;/a&gt; and &lt;a title="Platform (computing)" href="http://en.wikipedia.org/wiki/Platform_%28computing%29"&gt;platform&lt;/a&gt; free of charge. The PHP Group also provides the complete source code for users to build, customize and extend for their own use.&lt;br /&gt;PHP primarily acts as a &lt;a title="Filter (software)" href="http://en.wikipedia.org/wiki/Filter_%28software%29"&gt;filter&lt;/a&gt;. The PHP program takes input from a file or stream containing text and special PHP instructions and outputs another stream of data for display.&lt;br /&gt;From PHP 4, the PHP parser &lt;a title="Compilers" href="http://en.wikipedia.org/wiki/Compilers"&gt;compiles&lt;/a&gt; input to produce &lt;a title="Bytecode" href="http://en.wikipedia.org/wiki/Bytecode"&gt;bytecode&lt;/a&gt; for processing by the &lt;a title="Zend Engine" href="http://en.wikipedia.org/wiki/Zend_Engine"&gt;Zend Engine&lt;/a&gt;, giving improved performance over its &lt;a title="Interpreter (computing)" href="http://en.wikipedia.org/wiki/Interpreter_%28computing%29"&gt;interpreter&lt;/a&gt; predecessor. PHP 5 uses the Zend Engine II.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-1507745043853695529?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1507745043853695529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/1507745043853695529'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/php-usage.html' title='PHP Usage'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2865552588131115943.post-4743496118253265909</id><published>2007-08-16T03:19:00.000-07:00</published><updated>2007-08-16T03:20:17.558-07:00</updated><title type='text'>PHP History</title><content type='html'>PHP was written as a set of &lt;a title="Common Gateway Interface" href="http://en.wikipedia.org/wiki/Common_Gateway_Interface"&gt;CGI&lt;/a&gt; binaries in the &lt;a title="C (programming language)" href="http://en.wikipedia.org/wiki/C_%28programming_language%29"&gt;C programming language&lt;/a&gt; by the Danish/Greenlandic programmer &lt;a title="Rasmus Lerdorf" href="http://en.wikipedia.org/wiki/Rasmus_Lerdorf"&gt;Rasmus Lerdorf&lt;/a&gt; in 1994, to replace a small set of &lt;a title="Perl" href="http://en.wikipedia.org/wiki/Perl"&gt;Perl&lt;/a&gt; scripts he had been using to maintain his &lt;a title="Personal homepage" href="http://en.wikipedia.org/wiki/Personal_homepage"&gt;personal homepage&lt;/a&gt;.&lt;a title="" href="http://en.wikipedia.org/wiki/PHP#_note-3"&gt;[4]&lt;/a&gt; Lerdorf initially created PHP to display his &lt;a title="Résumé" href="http://en.wikipedia.org/wiki/R%C3%A9sum%C3%A9"&gt;résumé&lt;/a&gt; and to collect certain data, such as how much traffic his page was receiving. Personal Home Page Tools was publicly released on &lt;a title="June 8" href="http://en.wikipedia.org/wiki/June_8"&gt;8 June&lt;/a&gt; &lt;a title="1995" href="http://en.wikipedia.org/wiki/1995"&gt;1995&lt;/a&gt; after Lerdorf combined it with his own Form Interpreter to create PHP/FI (this release is considered PHP version 2).&lt;a title="" href="http://en.wikipedia.org/wiki/PHP#_note-4"&gt;[5]&lt;/a&gt;&lt;br /&gt;&lt;a title="Zeev Suraski" href="http://en.wikipedia.org/wiki/Zeev_Suraski"&gt;Zeev Suraski&lt;/a&gt; and &lt;a title="Andi Gutmans" href="http://en.wikipedia.org/wiki/Andi_Gutmans"&gt;Andi Gutmans&lt;/a&gt;, two Israeli developers at the &lt;a title="Technion IIT" href="http://en.wikipedia.org/wiki/Technion_IIT"&gt;Technion IIT&lt;/a&gt;, rewrote the &lt;a title="Parser" href="http://en.wikipedia.org/wiki/Parser"&gt;parser&lt;/a&gt; in 1997 and formed the base of PHP 3, changing the language's name to the &lt;a title="Recursive initialism" href="http://en.wikipedia.org/wiki/Recursive_initialism"&gt;recursive initialism&lt;/a&gt; PHP: Hypertext Preprocessor. The development team officially released PHP/FI 2 in November 1997 after months of &lt;a title="Development stage" href="http://en.wikipedia.org/wiki/Development_stage#beta"&gt;beta&lt;/a&gt; testing. Public testing of PHP 3 began and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the &lt;a title="Zend Engine" href="http://en.wikipedia.org/wiki/Zend_Engine"&gt;Zend Engine&lt;/a&gt; in 1999.&lt;a title="" href="http://en.wikipedia.org/wiki/PHP#_note-5"&gt;[6]&lt;/a&gt; They also founded &lt;a title="Zend Technologies" href="http://en.wikipedia.org/wiki/Zend_Technologies"&gt;Zend Technologies&lt;/a&gt; in &lt;a title="Ramat Gan" href="http://en.wikipedia.org/wiki/Ramat_Gan"&gt;Ramat Gan&lt;/a&gt;, Israel, which actively manages the development of PHP.&lt;br /&gt;In &lt;a title="May 2000" href="http://en.wikipedia.org/wiki/May_2000"&gt;May 2000&lt;/a&gt;, PHP 4, powered by the Zend Engine 1.0, was released. The most recent update released by The PHP Group, is for the older PHP version 4 code branch which, as of &lt;a title="May 2007" href="http://en.wikipedia.org/wiki/May_2007"&gt;May 2007&lt;/a&gt;, is up to version 4.4.7. PHP 4 will be supported by security updates until &lt;a title="August 8" href="http://en.wikipedia.org/wiki/August_8"&gt;8 August&lt;/a&gt; 2008&lt;a title="" href="http://en.wikipedia.org/wiki/PHP#_note-6"&gt;[7]&lt;/a&gt;.&lt;br /&gt;On &lt;a title="July 13" href="http://en.wikipedia.org/wiki/July_13"&gt;July 13&lt;/a&gt;, &lt;a title="2004" href="http://en.wikipedia.org/wiki/2004"&gt;2004&lt;/a&gt;, PHP 5 was released powered by the new Zend Engine II. PHP 5 included new features such as:&lt;a title="" href="http://en.wikipedia.org/wiki/PHP#_note-7"&gt;[8]&lt;/a&gt;&lt;br /&gt;Improved support for &lt;a title="Object-oriented programming" href="http://en.wikipedia.org/wiki/Object-oriented_programming"&gt;object-oriented programming&lt;/a&gt;&lt;br /&gt;The PHP Data Objects extension, which defines a lightweight and consistent interface for accessing databases&lt;br /&gt;Performance enhancements&lt;br /&gt;Better support for &lt;a title="MySQL" href="http://en.wikipedia.org/wiki/MySQL"&gt;MySQL&lt;/a&gt;&lt;br /&gt;Embedded support for &lt;a title="SQLite" href="http://en.wikipedia.org/wiki/SQLite"&gt;SQLite&lt;/a&gt;&lt;br /&gt;Integrated &lt;a title="SOAP" href="http://en.wikipedia.org/wiki/SOAP"&gt;SOAP&lt;/a&gt; support&lt;br /&gt;Data &lt;a title="Iterator" href="http://en.wikipedia.org/wiki/Iterator"&gt;iterators&lt;/a&gt;&lt;br /&gt;Error handling via &lt;a title="Exception handling" href="http://en.wikipedia.org/wiki/Exception_handling"&gt;exceptions&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2865552588131115943-4743496118253265909?l=php-teacher.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4743496118253265909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2865552588131115943/posts/default/4743496118253265909'/><link rel='alternate' type='text/html' href='http://php-teacher.blogspot.com/2007/08/php-history.html' title='PHP History'/><author><name>PHP Codes</name><uri>http://www.blogger.com/profile/17526424316613171405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
