<?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-602419274159677286</id><updated>2011-11-27T16:55:32.547-08:00</updated><title type='text'>PHP Programmer India, PHP Freelancer India, Software Developer, Web Developer India</title><subtitle type='html'>Amit Shah a PHP Programmer India providing Freelancing services over web.PHP Freelancer Amit Shah provides customization services in PHP opensources like Wordpress,Joomla,Code Igniter,Cake PHP,Smarty,Zen Cart.PHP Web Development solution provides by Amit Shah.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eramitpshah.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/602419274159677286/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://eramitpshah.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Amit Shah</name><uri>http://www.blogger.com/profile/07366957859611213158</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/-lgYc_1GcD6M/TbFeKawEvaI/AAAAAAAAAMc/iSsfK4PQN60/s220/BirthdayPic.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-602419274159677286.post-4909354410253786800</id><published>2011-01-17T08:18:00.000-08:00</published><updated>2011-01-17T08:31:26.767-08:00</updated><title type='text'>PHP 4 Vs PHP 5</title><content type='html'>&lt;h3&gt;Object Model&lt;/h3&gt;&lt;br /&gt;The Object Model was present in PHP 4, but it was completely reworked in PHP&lt;br /&gt;5. Here are some of the most important updates:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Passed by Reference&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;This is one of the most important innovations in PHP 5. In PHP 4 everything,&lt;br /&gt;including objects, was passed by value. This has been changed in PHP 5 where&lt;br /&gt;everything is passed by reference.&lt;br /&gt;&lt;br /&gt;PHP Code:&lt;br /&gt;&lt;div&gt;$pObject1 = new Object(); $pObject1-&amp;gt;setName('Adam'); $pObject1-&amp;gt;setAddress('http://www.talkphp.com/');&lt;br /&gt;$pObject2 = new Object(); $pObject2-&amp;gt;setName('Karl'); $pObject2-&amp;gt;setAddress('http://www.talkphp.com/');&lt;/div&gt;&lt;br /&gt;This is a typical PHP 4 code - if you wanted to duplicate an object, you had&lt;br /&gt;to copy it and assign a new value to it. In PHP 5 the coder can simply use&lt;br /&gt;the “clone”. This also means that you no longer need to use the reference operator&lt;br /&gt;(&amp;amp;) for your code. Here is how the same code will look in PHP 5 :&lt;br /&gt;&lt;div&gt;$pObject1 = new Object(); $pObject1-&amp;gt;setName('Adam'); $pObject1-&amp;gt;setAddress('http://www.talkphp.com/');&lt;br /&gt;$pObject2 = clone $pObject1; $pObject2-&amp;gt;setName('Karl');&lt;/div&gt;&lt;br /&gt;Since we were chaning only the name, we "cloned" the first object and simply&lt;br /&gt;changed the value that needed changing.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Class Constants and Static Methods/Properties&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;With PHP 5 you can safely create class constants that act in very much the&lt;br /&gt;same way as do defined constants, but are limited within a class definition&lt;br /&gt;and can be accessed with “::”. Have in mind that constants must have a constant&lt;br /&gt;expression for a value; they can't be equal to a variable or a result of&lt;br /&gt;a function call.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Visibility&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;Public - the most visible. Methods can be read by everyone and properties&lt;br /&gt;can be written or read by anyone.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Protected - the members are visible only by the actual class they are&lt;br /&gt;a part of, as well as by subclasses and parent classes.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Private - members are visible only to the actual class they are a part&lt;br /&gt;of.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;In PHP 5 another addition is the “visibility” of the class methods and properties.&lt;br /&gt;The visibility has 3 levels:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Here is an example of how members are declared&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&amp;lt;?php&lt;/strong&gt; /** * Define ClassA */ class ClassA { public&lt;br /&gt;$public = 'Public'; protected $protected = 'Protected'; private $private&lt;br /&gt;= 'Private'; function printHello() { echo $this-&amp;gt;public; echo $this-&amp;gt;protected;&lt;br /&gt;echo $this-&amp;gt;private; } } $bor = new ClassA(); echo $bor-&amp;gt;public; //&lt;br /&gt;Will work echo $bor-&amp;gt;protected; // Will give you a fatal error echo $bor-&amp;gt;private;&lt;br /&gt;// Will give you a fatal error $obj-&amp;gt;printHello(); // Will display Public,&lt;br /&gt;Protected and Private /** * Define ClassB */ class ClassB extends ClassA&lt;br /&gt;{ // we can redeclare both the public and protected method, but we can't&lt;br /&gt;redeclare the private one protected $protected = 'Protected2'; function printHello()&lt;br /&gt;{ echo $this-&amp;gt;public; echo $this-&amp;gt;protected; echo $this-&amp;gt;private;&lt;br /&gt;} } $obj2 = new MyClass2(); echo $obj2-&amp;gt;public; // Will work echo $obj2-&amp;gt;private;&lt;br /&gt;// Is now undefined echo $obj2-&amp;gt;protected; // Will display a fatal error&lt;br /&gt;$obj2-&amp;gt;printHello(); // Will show you Public, Protected2, Undefined &lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Unified Constructors and Destructors&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;In PHP 4 the constructor was just a method with the same name as the name&lt;br /&gt;of the class. So, if you changed the name of the class, you had to go and&lt;br /&gt;update it every time it was used.&lt;br /&gt;&lt;br /&gt;In PHP 5, to spare the coders this hassle, the PHP developers have created&lt;br /&gt;an unified name for the constructors - "__construct()".&lt;br /&gt;&lt;br /&gt;A new addition is the "__destruct()" keyword. When used, the code will be&lt;br /&gt;executed only when the object is destroyed.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Abstract Classes&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;With PHP 5 you can also create the so called “abstract” classes. These are&lt;br /&gt;classes, which are used only as a model to define other classes. If a certain&lt;br /&gt;class contains abstract method, it must be defined as abstract.&lt;br /&gt;&lt;br /&gt;Here is how a normal class is defined:&lt;br /&gt;&lt;div&gt;class Message{&lt;/div&gt;&lt;br /&gt;and here is how an abstract class is defined:&lt;br /&gt;&lt;div&gt;abstract class Message{&lt;/div&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Interfaces&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;Another new addition in PHP 5 is the “Interfaces”, which can help you design&lt;br /&gt;an API. The interface will define the methods, which must be implemented&lt;br /&gt;in a class. Have in mind that all methods which are defined in an interface&lt;br /&gt;must be public.&lt;br /&gt;&lt;br /&gt;A big advantage of this new addition is that in a class you can implement&lt;br /&gt;any number of interfaces.&lt;br /&gt;&lt;br /&gt;Here is how it all works : &lt;strong&gt;an example of a simple class:&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;class cow { function moo() { echo "moo, moo, moo …"; } }&lt;/div&gt;&lt;br /&gt;&lt;strong&gt;and now we implement the interface in the class:&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;class cow implements animal{ function moo() { echo "moo, moo, moo …";&lt;br /&gt;} function breath() { echo "cow is breathing …";} function eat() { echo "cow&lt;br /&gt;is easting …";} }&lt;/div&gt;&lt;br /&gt;When an interface is implemented in a class, the class MUST define all methods&lt;br /&gt;and functions of the interface, otherwise the php parser will show a fatal&lt;br /&gt;error.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Magic Methods&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;All methods, starting with a double underscore ("__") are defined as   "Magic&lt;br /&gt;Methods". They are set to additional functionality to the classes. It's recommended&lt;br /&gt;that you don't use methods with the same naming pattern.&lt;br /&gt;&lt;br /&gt;Some of the most used magic methods are: __call, __get, __set and __toString.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Finality&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;The "final" keyword has been introduced, so that a method cannot be overridden&lt;br /&gt;by a child now. This keyword can also be used to finalize a class in order&lt;br /&gt;to prevent it from having children.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;The __autoload function&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;A very useful function added in PHP 5, which can save the usage of several&lt;br /&gt;includes in the begging of the file. The __autoload function will load object&lt;br /&gt;files automatically when PHP encounters an undefined yet class.&lt;br /&gt;&lt;div&gt;function __autoload($class_name) { require_once "./includes/classes/$class_name.inc.php";&lt;br /&gt;}&lt;/div&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Introduction of Standard PHP Library (SPL)&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;The Standard &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; Library&lt;br /&gt;(SPL) is a set of interfaces for PHP, whose aim is to implement more efficient&lt;br /&gt;data access interfaces and classes. This functionality is designed to ease&lt;br /&gt;the access to aggregate structures, such as arrays, database result sets, &lt;a href="http://www.ntchosting.com/php/php-xml-parser.html"&gt;XML&lt;/a&gt; trees,&lt;br /&gt;directory listings or any other lists. At the moment, SPL works mainly with&lt;br /&gt;Iterators.&lt;br /&gt;&lt;br /&gt;The main benefit of this is that, since now it is set as Standard, it can&lt;br /&gt;be used by everybody to provide better coding practices.&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Miscellaneous Features and Updates&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Here are the rest of the features, which do not fall into the previous categories.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;Type Hinting&lt;/li&gt;&lt;br /&gt;Limited Type Hinting is introduced in &lt;a href="http://www.ntchosting.com/php/php5.html"&gt;PHP&lt;br /&gt;5&lt;/a&gt;. Now the coder can select which kinds of variables can be passed&lt;br /&gt;to class methods or functions. For the moment, this feature works with&lt;br /&gt;classes or arrays only - integers and strings are not supported.&lt;br /&gt;&lt;div&gt;function echo_user(User $user) {&lt;br /&gt;&lt;br /&gt;echo $user-&amp;gt;getUsername();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;A fatal error will appear if the passed parameter is not User or a subclass&lt;br /&gt;of User.&lt;br /&gt; &lt;li&gt;Exceptions&lt;/li&gt;&lt;br /&gt;Exceptions are finally added in PHP in the 5th revision of the programming&lt;br /&gt;language. While the exception is basically an error, by using it you&lt;br /&gt;can control the simple trigger_error notices, which were unchangeable&lt;br /&gt;in &lt;a href="http://www.ntchosting.com/php/php4.html"&gt;PHP 4&lt;/a&gt;.&lt;br /&gt;&lt;div&gt;try {&lt;br /&gt;&lt;br /&gt;$cache-&amp;gt;write();&lt;br /&gt;&lt;br /&gt;} catch (AccessDeniedException $e) {&lt;br /&gt;&lt;br /&gt;die('Unable to write the cache, access denied.');&lt;br /&gt;&lt;br /&gt;} catch (Exception $e) {&lt;br /&gt;&lt;br /&gt;die('Unknown error occurred : ' . $e-&amp;gt;getMessage());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The exceptions are basically just objects. When an error occurs you can&lt;br /&gt;use an exception in its place. This way, when an exception is used, the&lt;br /&gt;rest of the following PHP code will not be executed.&lt;br /&gt;&lt;br /&gt;If you are about to do something, the result of which you are unsure, you&lt;br /&gt;can surround it with a “try” block and this way, if something happens,&lt;br /&gt;your catch block is there to catch the error message and handle it respectively.&lt;br /&gt; &lt;li&gt;E_STRICT Error Level&lt;/li&gt;&lt;br /&gt;In PHP 5 a new error lever is introduced - the E_STRICT error level.&lt;br /&gt;It's not included in E_ALL by default, so in order to use it, you will&lt;br /&gt;have to specify it. Its function is to notify you when deprecated code&lt;br /&gt;is used.&lt;br /&gt; &lt;li&gt;New Extensions&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;SimpleXML - for an easier processing of XML data&lt;/li&gt;&lt;br /&gt; &lt;li&gt;DOM and XSL - their goal is to act in the place of DOMXML in PHP&lt;br /&gt;4. With them, XML usage is much easier.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PDO - a very good OO interface for interacting with databases&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Hash - you now have access to a lot of hash functions beside the&lt;br /&gt;most popular ones - md 5 and sha1&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;Several new extensions are added in PHP 5. Among them, the most useful&lt;br /&gt;are:&lt;br /&gt; &lt;li&gt;New Functions&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;array_combine() - it will create one array, using another two arrays&lt;br /&gt;- one for the keys and one for their values&lt;/li&gt;&lt;br /&gt; &lt;li&gt;array_walk_recursive() - a user function is applied recursively to&lt;br /&gt;all of the array members&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;ibase_db_info() - it will request the statistics for a database&lt;/li&gt;&lt;br /&gt; &lt;li&gt;ibase_name_result() - it will assign a name to a set of results&lt;/li&gt;&lt;br /&gt; &lt;li&gt;ibase_service_attach() - this function will connect you to the service&lt;br /&gt;manager&lt;/li&gt;&lt;br /&gt; &lt;li&gt;ibase_affected_rows() - it will return the number of rows affected&lt;br /&gt;by the previous query&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;iconv_strlen() - it will return the character count of a string&lt;/li&gt;&lt;br /&gt; &lt;li&gt;iconv_substr() - it will cut a part of a string&lt;/li&gt;&lt;br /&gt; &lt;li&gt;iconv_mime_decode_headers() - this function will decode several MIME&lt;br /&gt;headers at the same time&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;stream_copy_to_stream() - it will copy the data from one stream to&lt;br /&gt;another stream&lt;/li&gt;&lt;br /&gt; &lt;li&gt;stream_socket_get_name() - it will find the names of the local and&lt;br /&gt;remote sockets&lt;/li&gt;&lt;br /&gt; &lt;li&gt;stream_socket_sendto() - it will send a message to a socket, no matter&lt;br /&gt;if this socket is connected or not&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;date_sunset() - it will give you the time of the sunset for a given&lt;br /&gt;day and location&lt;/li&gt;&lt;br /&gt; &lt;li&gt;idate() - it will format the local time and date as an integer&lt;/li&gt;&lt;br /&gt; &lt;li&gt;date_sunrise() - it will give you the time of the sunrise for a given&lt;br /&gt;day and location&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;str_split() - it will convert a string to an array&lt;/li&gt;&lt;br /&gt; &lt;li&gt;strpbrk() - it will search the string for any set of characters specified&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;A lot of new functions are added to PHP 5. Here is a short list of&lt;br /&gt;the new additions:&lt;br /&gt;&lt;br /&gt;Arrays:&lt;br /&gt;InterBase:&lt;br /&gt;iconv:&lt;br /&gt;Streams:&lt;br /&gt;Date and time related:&lt;br /&gt;Strings:&lt;br /&gt;For a full list of the new functions, you can visit the &lt;a href="http://php.net/manual/en/migration5.functions.php"&gt;PHP&lt;br /&gt;Manual page&lt;/a&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Compatibility Issues&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;array_merge() will now give you warnings if any of the parameters are&lt;br /&gt;not arrays. In PHP4, you could get away with merging non-arrays with arrays&lt;br /&gt;(and the items would just be added if they were say, a string). Of course&lt;br /&gt;it was bad practice to do this to begin with, but it can cause headaches&lt;br /&gt;if you don't know about it.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;As discussed above, objects are now passed by references. If you want&lt;br /&gt;to copy an object, make sure to use the clone keyword.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;get_*() now returns names as they were defined. If a class was called&lt;br /&gt;MyTestClass, then get_class() would return that -- case sensitive! In PHP4,&lt;br /&gt;they were always returned in lowercase.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;An object with no properties is no longer considered "empty".&lt;/li&gt;&lt;br /&gt; &lt;li&gt;In some cases classes must be declared before use. It only happens if&lt;br /&gt;some of the new features of PHP 5 (such as interfaces) are used.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;A section, which is vital to a lot of users. PHP 5, for the most part,&lt;br /&gt;is backwards compatible with PHP 4. However, there are some things that coders&lt;br /&gt;should bear in mind. Here is a set of the most commonly encountered issues:&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602419274159677286-4909354410253786800?l=eramitpshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eramitpshah.blogspot.com/feeds/4909354410253786800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eramitpshah.blogspot.com/2011/01/php-4-vs-php-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/602419274159677286/posts/default/4909354410253786800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/602419274159677286/posts/default/4909354410253786800'/><link rel='alternate' type='text/html' href='http://eramitpshah.blogspot.com/2011/01/php-4-vs-php-5.html' title='PHP 4 Vs PHP 5'/><author><name>Amit Shah</name><uri>http://www.blogger.com/profile/07366957859611213158</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/-lgYc_1GcD6M/TbFeKawEvaI/AAAAAAAAAMc/iSsfK4PQN60/s220/BirthdayPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-602419274159677286.post-9171953738669837705</id><published>2008-02-11T00:34:00.001-08:00</published><updated>2011-04-22T04:00:36.245-07:00</updated><title type='text'>PHP Programmer - Amit Shah</title><content type='html'>&lt;p&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Amit Shah&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; provides you some information which will help to improve your knowledge. &lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;By &lt;span style="font-weight: bold;"&gt;Amit Shah - PHP Programmer&lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;span class="blogdesc"&gt;PHP, PHP + MySQL, java script, AJAX, Programming, Web Development and services by - Amit Shah(C.E), Programming in cheap cost, Reliable services in PHP by Amit Shah, low cost for web development in PHP by Amit Shah, PHP Programmer.&lt;/span&gt;&lt;form method="get" action="http://www.google.com/custom" target="_top"&gt;&lt;table width="400"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;     &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/form&gt;&lt;h3&gt;What is PHP?&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;PHP stands for &lt;strong&gt;P&lt;/strong&gt;HP: &lt;strong&gt;H&lt;/strong&gt;ypertext &lt;strong&gt;P&lt;/strong&gt;reprocessor&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP is a server-side scripting language, like ASP&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP scripts are executed on the server&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP is an open source software&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP is free to download and use&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;What is a PHP File?&lt;/h3&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;PHP files can contain text, HTML tags and scripts&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP files are returned to the browser as plain HTML &lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP files have a file extension of ".php", ".php3", or ".phtml"&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;What is MySQL?&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;MySQL is a database server&lt;/li&gt;&lt;br /&gt; &lt;li&gt;MySQL is ideal for both small and large applications&lt;/li&gt;&lt;br /&gt; &lt;li&gt;MySQL supports standard SQL&lt;/li&gt;&lt;br /&gt; &lt;li&gt;MySQL compiles on a number of platforms&lt;/li&gt;&lt;br /&gt; &lt;li&gt;MySQL is free to download and use&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;PHP + MySQL&lt;/h3&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Why PHP?&lt;/h3&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;PHP runs on different platforms (Windows, Linux, Unix, etc.)&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP is compatible with almost all servers used today (Apache, IIS, etc.)&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP is FREE to download from the official PHP resource: &lt;a target="_blank" href="http://www.php.net/"&gt;www.php.net&lt;/a&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PHP is easy to learn and runs efficiently on the server side&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Variables in PHP&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Variables are used for storing a values, like text strings, numbers or   arrays.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When a variable is declared, it can be used over and over again in your scrilit.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;All variables in PHP start with a $ sign symbol.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The correct way of declaring a variable in PHP:&lt;/li&gt;&lt;br /&gt;&lt;h3&gt;PHP is a Loosely Typed Language&lt;/h3&gt;&lt;br /&gt;&lt;li&gt;In PHP, a variable does not need to be declared before adding a value to it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In the example above, you see that you do not have to tell PHP which data   type the variable is.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;PHP automatically converts the variable to the correct data type, depending   on its value.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In a strongly typed programming language, you have to declare (define) the   type and name of the variable before using it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In PHP, the variable is declared automatically when you use it.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Naming Rules for Variables&lt;/h3&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;A variable name must start with a letter or an underscore "_"&lt;/li&gt;&lt;br /&gt; &lt;li&gt;A variable name can only contain alpha-numeric characters and underscores    (a-z, A-Z, 0-9, and _ )&lt;/li&gt;&lt;br /&gt; &lt;li&gt;A variable name should not contain spaces. If a variable name is more than one word,    it should be separated with    an underscore ($my_string), or with capitalization ($myString)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;String Variables in PHP&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;String variables are used for values that contains characters.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In this chapter we are going to look at the most common functions   and operators used to manipulate strings in PHP.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;After we create a string we can manipulate it. A string can be used directly   in a function or it can be stored in a variable.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Below, the PHP script assigns the text "Hello World" to a string variable called $txt:&lt;/li&gt;&lt;br /&gt;&lt;h3&gt;The Concatenation Operator&lt;/h3&gt;&lt;br /&gt;&lt;li&gt;There is only one string operator in PHP.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The concatenation operator (.)  is used to put two string values together.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;To concatenate two string variables together, use the concatenation operator:&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Conditional Statements&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Very often when you write code, you want to perform different actions for   different decisions. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;You can use conditional statements in your code to do this.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In PHP we have the following conditional statements:&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;if statement&lt;/strong&gt; - use this statement to execute some code only if a specified condition is true&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;if...else statement&lt;/strong&gt; - use this statement to execute some code if a condition is true and another    code if the condition is false&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;if...elseif....else statement&lt;/strong&gt; - use this statement to select one of    several blocks of code to be executed&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;switch statement&lt;/strong&gt; - use this statement to select one of many blocks of code to be executed&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;What is an Array?&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You have already learnt that a variable is a storage area holding numbers and   text. The problem is, a variable will hold only one value.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;An array is a special variable, which can hold more than one value, at a time.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you have a list of items (a list of car names, for example), storing the cars   in single variables could look like this:&lt;/li&gt;&lt;br /&gt;&lt;li&gt;An array can hold all your variable values under a single name. And you can access the values by referring to the array name.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Each element in the array has its own index so that it can be easily accessed.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In PHP, there are three kind of arrays:&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Numeric array&lt;/strong&gt; - An array with a numeric index&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Associative array&lt;/strong&gt; - An array where each ID key is associated with a value&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;Multidimensional array&lt;/strong&gt; - An array containing one or more arrays&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Numeric Arrays&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;A numeric array stores each array element with a numeric index.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There are two methods to create a numeric array.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;1. In the following example the index are automatically assigned (the index   starts at 0):&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Associative Arrays&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An associative array, each ID key is associated with a value.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When storing data about specific named values, a numerical array is not   always the best way to do it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;With associative arrays we can use the values as keys and assign values   to them.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Multidimensional Arrays&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In a multidimensional array, each element in the main array can also be an array.   And each element in the sub-array can be an array, and so on.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;PHP Loops&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Often when you write code, you want the same block of code to run over and   over again in a row. Instead of adding several almost equal lines in a script we   can use loops to perform a task like this.&lt;/p&gt;In PHP, we have the following looping statements:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;while &lt;/strong&gt;- loops through a block of code while a specified condition is true&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;do...while&lt;/strong&gt; - loops through a block of code once, and then repeats the loop     as long as a specified condition is true&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;for &lt;/strong&gt;- loops through a block of code a specified number of times&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;strong&gt;foreach &lt;/strong&gt;- loops through a block of code for each element in an     array&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;PHP Functions&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In this chapter we will show you how to create your own functions.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;To keep the browser from executing a script when the page loads, you can put   your script into a function.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;A function will be executed by a call to the function.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You may call a function from anywhere within a page.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;PHP Functions - Adding parameters&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;To add more functionality to a function, we can add parameters. A parameter is just like a variable.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Parameters are specified after the function name, inside the parentheses.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;br /&gt;&lt;!--Session data--&gt;&lt;br /&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602419274159677286-9171953738669837705?l=eramitpshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eramitpshah.blogspot.com/feeds/9171953738669837705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eramitpshah.blogspot.com/2008/02/http-authentication-with-php-http.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/602419274159677286/posts/default/9171953738669837705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/602419274159677286/posts/default/9171953738669837705'/><link rel='alternate' type='text/html' href='http://eramitpshah.blogspot.com/2008/02/http-authentication-with-php-http.html' title='PHP Programmer - Amit Shah'/><author><name>Amit Shah</name><uri>http://www.blogger.com/profile/07366957859611213158</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/-lgYc_1GcD6M/TbFeKawEvaI/AAAAAAAAAMc/iSsfK4PQN60/s220/BirthdayPic.jpg'/></author><thr:total>0</thr:total></entry></feed>
