<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEQBSX8zeSp7ImA9WhRaE0o.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266</id><updated>2012-02-15T23:12:38.181-08:00</updated><category term="Object sort by Key value using PHP" /><category term="Curl Concept with Example" /><category term="Optimize the tables using PHP" /><category term="Custom Sort function" /><category term="Remove the Duplicate sub-Array element" /><category term="Important PHP functions" /><category term="Database concepts" /><category term="Webservice" /><category term="File Vs Function Vs Method Vs Extension Existance" /><category term="Show / Hide Display errors in PHP" /><category term="MySQL" /><category term="Abstract class and Interface:" /><category term="zencart vs oscommerce" /><category term="Validating Multiple Checkbox with example" /><category term="Complicated Queries in MySQL" /><category term="Webservice in SOAP using PHP" /><category term="SSL Certificate and its purpose?" /><category term="MySQL INDEX" /><category term="Interview Questions" /><category term="Regular Expression" /><category term="RLIKE" /><category term="Array sort by Key value using PHP" /><category term="Google Finance API  Sample PHP Code" /><title>PHP &amp; MySQL</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://allthephp.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>phpexpert</name><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>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/KEpx" /><feedburner:info uri="blogspot/kepx" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DU8CQXwycCp7ImA9WhRbFkU.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-3099504639625450888</id><published>2012-02-07T22:51:00.000-08:00</published><updated>2012-02-07T23:57:40.298-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-07T23:57:40.298-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Abstract class and Interface:" /><title>Information about Class, Abstract class and Interface</title><content type="html">&lt;div style="color: #073763;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;Abstract class:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Similarities with Class:&lt;/b&gt;&lt;br /&gt;
Abstract class is a type of class which can have all the ability of a Class.&amp;nbsp; Abstract class can have data members member functions, All Access Specifier like Private, Public and Protected, Constructor &amp;amp; Destructor.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Controversies with Class:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Abstract class cannot be instantiate with its own.&amp;nbsp; Abstract class data members, member functions can be called through only its derived classes.&lt;br /&gt;
&lt;br /&gt;
Every normal methods within the Abstract class should have its function definition or body content.&lt;br /&gt;
&lt;br /&gt;
Every abstract methods within the Abstract class shouldn't have its function definition or body content.&amp;nbsp; If we use function prefix with abstract keyword then the function is called as abstract function.&amp;nbsp; Private visibility is &lt;br /&gt;
not possible to create abstract function.&amp;nbsp; Public and protected will works function.&amp;nbsp; If an abstract class &lt;br /&gt;
abstract function is written in one class, then the derived class should have the function definition in it; else&lt;br /&gt;
error will be displayed.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
Advantages of Abstract Class:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If we have a common functionality used throughout the application then we can use a certain data members and its member functions.&amp;nbsp; This data member, member function are optional for the derived class.&amp;nbsp; The derived class can use the abstract class or not.. that is depends on the class nature.&lt;br /&gt;
&lt;br /&gt;
Only one abstract class can be inherited into a normal class using the keyword 'extends'.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #134f5c;"&gt;&lt;span style="font-size: large;"&gt;&lt;u&gt;&lt;b&gt;Interface:&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Similarity with Class:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Partially we can call the interface as class.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Controversies with Class:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Interface cannot be instantiate with its own.&amp;nbsp; Interface does not have data members but have member functions without function definition; just list abstract functions.&lt;br /&gt;
&lt;br /&gt;
Every methods in Interface should be Public or blank access speficiers (Visibility).&lt;br /&gt;
&lt;br /&gt;
We can inherit multiple interfaces into a normal class using the keyword as 'implements'&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Hirarchy of inheriting:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If we want to inherit both abstract class and interface class then we need to inherit the abstract class at first&lt;br /&gt;
and can inherit 'N' number of interfaces into the normal class.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Exceptions:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We can inherit only abstract also into a normal class.&lt;br /&gt;
We can inherit only interface (1 or more interfaces) also into a normal class.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;u&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/u&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
abstract class hisabstract {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private $hismember1 = 'didnt_called_yet';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; const mymember1 = 'test';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function __construct(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
&lt;b&gt;calling hisabstract constructor..&lt;/b&gt;";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public function hispublic (){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; $this-&amp;gt;hisprivate();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; echo "&lt;br /&gt;
Previously called method is: ".$this-&amp;gt;hismember1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; echo "&lt;br /&gt;
i am in myabstract class";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; $this-&amp;gt;hismember1 = __method__;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected function hisprotected (){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; echo "&lt;br /&gt;
Previously called method is: ".$this-&amp;gt;hismember1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; echo "&lt;br /&gt;
i am in myabstract class with function name as : ".__function__;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; $this-&amp;gt;hismember1 = __method__;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private function hisprivate(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; echo "&lt;br /&gt;
Previously called method is: ".$this-&amp;gt;hismember1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; echo "&lt;br /&gt;
i am in myabstract class with function name as : ".__function__;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; $this-&amp;gt;hismember1 = __method__;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function __destruct(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
&lt;b&gt;calling hisabstract destructor..&lt;/b&gt;";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; abstract function hisabstract_memfunc();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; final function hisabstract_finalfunc(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
function from hisabstract class .. it is actully a final function.";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface myinterface {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public function mypublic ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface yourinterface {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function yourpublic ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class mano extends hisabstract implements myinterface, yourinterface {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function mypublic(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
calling hisabstract function definition..".$this-&amp;gt;hisprotected();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
myinterface function definition..".$this-&amp;gt;mymember1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;yourpublic();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return $this;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function yourpublic(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
yourinterface function definition..".$this-&amp;gt;hispublic();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function hisabstract_memfunc(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&lt;br /&gt;
his abstract class abstract function definition..";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;hisabstract_finalfunc();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$x = new mano;&lt;br /&gt;
$x-&amp;gt;mypublic()-&amp;gt;hisabstract_memfunc();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-3099504639625450888?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/n3Z68jS9EAKrdMVHnmERkAQZ14s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n3Z68jS9EAKrdMVHnmERkAQZ14s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/n3Z68jS9EAKrdMVHnmERkAQZ14s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n3Z68jS9EAKrdMVHnmERkAQZ14s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/lirMhT_KRYM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/3099504639625450888/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=3099504639625450888" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3099504639625450888?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3099504639625450888?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/lirMhT_KRYM/information-about-class-abstract-class.html" title="Information about Class, Abstract class and Interface" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2012/02/information-about-class-abstract-class.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4MRnw9fip7ImA9WhRSFk4.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-725549087456009270</id><published>2011-11-18T08:30:00.001-08:00</published><updated>2011-11-18T08:33:07.266-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-18T08:33:07.266-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Optimize the tables using PHP" /><title>Optimize the tables in a Database using PHP</title><content type="html">$alltables = db_query("SHOW TABLES");&lt;br /&gt;
while ($tablename = db_result($alltables)) {&lt;br /&gt;
&amp;nbsp; db_query("OPTIMIZE TABLE '".$tablename."'");&lt;br /&gt;
&amp;nbsp; echo $tablename." optimized now";&lt;br /&gt;
}&lt;br /&gt;
echo 'All tables optimized successfully';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-725549087456009270?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wpXiOJPhhQMJOX2NfGl6EdYem_U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wpXiOJPhhQMJOX2NfGl6EdYem_U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wpXiOJPhhQMJOX2NfGl6EdYem_U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wpXiOJPhhQMJOX2NfGl6EdYem_U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/lRM7Vy1AAos" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/725549087456009270/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=725549087456009270" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/725549087456009270?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/725549087456009270?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/lRM7Vy1AAos/optimize-tables-in-database-using-php.html" title="Optimize the tables in a Database using PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/11/optimize-tables-in-database-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIDQnw4fCp7ImA9WhdUEU4.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-2890784603633247830</id><published>2011-09-27T08:48:00.000-07:00</published><updated>2011-09-27T08:49:33.234-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-27T08:49:33.234-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Custom Sort function" /><category scheme="http://www.blogger.com/atom/ns#" term="Remove the Duplicate sub-Array element" /><title>Remove the Duplicate sub-Array element using PHP</title><content type="html">/* &lt;br /&gt;
&amp;nbsp;* Function to Remove the Duplicate sub-Array element. &lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
function removeDuplicateArraybyElement(&amp;amp;$searchArray, $searchKey){&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* Sorting the array values */&lt;br /&gt;
&amp;nbsp; objectSort($searchArray, $searchKey);&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; /* Removing duplicate array values*/&lt;br /&gt;
&amp;nbsp; $searchBackupValue = "";&lt;br /&gt;
&amp;nbsp; $output = array ();&lt;br /&gt;
&amp;nbsp; foreach ($searchArray as $key =&amp;gt; $sub_array){&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if ($searchBackupValue != $sub_array-&amp;gt;$searchKey){&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;$output[] = $sub_array;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;$searchBackupValue = $sub_array-&amp;gt;$searchKey;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; $searchArray = $output;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Example with Drupal Code:&lt;/b&gt;&lt;/u&gt; &lt;br /&gt;
&lt;br /&gt;
$products = taxonomy_get_tree(13, 0, -1, 1);&lt;br /&gt;
removeDuplicateArraybyElement($products, 'name');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-2890784603633247830?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Pddq0vKB5znQJjFI2anlCaERD0M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pddq0vKB5znQJjFI2anlCaERD0M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Pddq0vKB5znQJjFI2anlCaERD0M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pddq0vKB5znQJjFI2anlCaERD0M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/EUAyZ7ddl0k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/2890784603633247830/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=2890784603633247830" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/2890784603633247830?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/2890784603633247830?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/EUAyZ7ddl0k/remove-duplicate-sub-array-element.html" title="Remove the Duplicate sub-Array element using PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/09/remove-duplicate-sub-array-element.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YDRXY6eip7ImA9WhdUEEw.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-8692633673882888588</id><published>2011-09-25T23:22:00.000-07:00</published><updated>2011-09-25T23:39:34.812-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-25T23:39:34.812-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SSL Certificate and its purpose?" /><title>What is SSL and its purpose?</title><content type="html">&lt;b&gt;For most e-commerce  sites, you absolutely need an SSL certificate!&lt;/b&gt;&amp;nbsp;  As an online merchant, it is your  responsibility to make sure the  information you collect from your customers is  protected. This will  shield you and your customers by making sure that no one  can intercept  and misuse their credit card information.&lt;br /&gt;
&lt;br /&gt;
If you accept credit card information and store it in a  database so you  can process it using an offline POS machine or charge it  manually on  your merchant account’s website, then you definitely need an SSL   certificate to secure the credit card data as it is transferred. You  also need  to be very careful with the data when it is stored on your  servers.&lt;br /&gt;
&lt;br /&gt;
If your e-commerce site forwards your visitors to a 3rd  party payment  processor (like PayPal) to enter the credit card  information then &lt;b&gt;you  don’t need an SSL certificate&lt;/b&gt; because your website won’t touch  the  credit card information.&lt;br /&gt;
&lt;br /&gt;
If your users enter a username and password to login to your  site  without an SSL certificate, an attacker can easily see their username  and  password in clear text. This would allow someone else to  impersonate your  visitor, but it allows for a far more dangerous  possibility:&lt;br /&gt;
&lt;br /&gt;
If you have a login form or send or receive private  customer  information, then you need SSL. If you run an e-commerce website where   people provide you with credit card information directly on your site, &lt;b&gt;you absolutely need SSL&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Great! So you’re now sure that you need SSL for your  e-commerce or other type of site.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://info.ssl.com/article.aspx?id=10694"&gt;How do i get a SSL Certificates?&lt;/a&gt;&amp;nbsp; &lt;a href="http://info.ssl.com/article.aspx?id=10694"&gt;Click here.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Trial SSL Certificates&lt;/b&gt;&lt;/u&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;span style="font-size: small;"&gt;Get a Free SSL Certificate from Comodo&lt;/span&gt;&lt;/h2&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Test&lt;/strong&gt; your new site's SSL security certificate before it goes live.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;See how easy it is to work with Comodo - Install your Certificate instantly.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Don't let your security lapse - get a free certificate and stay secure if your current cert is expiring soon.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;&lt;a href="http://www.instantssl.com/ssl-certificate-products/free-ssl-certificate.html"&gt;Click here&lt;/a&gt;&amp;nbsp; &lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-8692633673882888588?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K2C02eF1IGD9md-MtI-5moukfes/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K2C02eF1IGD9md-MtI-5moukfes/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K2C02eF1IGD9md-MtI-5moukfes/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K2C02eF1IGD9md-MtI-5moukfes/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/OS27DAFZQI8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/8692633673882888588/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=8692633673882888588" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8692633673882888588?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8692633673882888588?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/OS27DAFZQI8/what-is-ssl-and-its-purpose.html" title="What is SSL and its purpose?" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/09/what-is-ssl-and-its-purpose.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAMRn04cCp7ImA9WhdVFUU.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-3692519059857824571</id><published>2011-09-20T23:33:00.000-07:00</published><updated>2011-09-20T23:33:07.338-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-20T23:33:07.338-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Custom Sort function" /><category scheme="http://www.blogger.com/atom/ns#" term="Object sort by Key value using PHP" /><title>Object sort by Key value using PHP</title><content type="html">/**&lt;br /&gt;
&amp;nbsp;* Function to swap two array with Values.&lt;br /&gt;
&amp;nbsp;* @param $&amp;amp;$data&lt;br /&gt;
&amp;nbsp;*&amp;nbsp;&amp;nbsp; Array to be passed for swapping.&lt;br /&gt;
&amp;nbsp;* @param $key&lt;br /&gt;
&amp;nbsp;*&amp;nbsp;&amp;nbsp; Filed name to be checked for&lt;br /&gt;
&amp;nbsp;* @return&lt;br /&gt;
&amp;nbsp;*&amp;nbsp;&amp;nbsp; Swapped array.&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
function objectSort(&amp;amp;$data, $key) {&lt;br /&gt;
&amp;nbsp; for ($i = count($data) - 1; $i &amp;gt;= 0; $i--) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $swapped = false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for ($j = 0; $j &amp;lt; $i; $j++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($data[$j]-&amp;gt;$key &amp;gt; $data[$j + 1]-&amp;gt;$key){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $tmp = $data[$j];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data[$j] = $data[$j + 1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data[$j + 1] = $tmp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $swapped = true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!$swapped) return;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-3692519059857824571?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9wTGxbZeAqYHwqN6vCb7VTU02-o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9wTGxbZeAqYHwqN6vCb7VTU02-o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9wTGxbZeAqYHwqN6vCb7VTU02-o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9wTGxbZeAqYHwqN6vCb7VTU02-o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/omM7sK8WRXg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/3692519059857824571/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=3692519059857824571" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3692519059857824571?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3692519059857824571?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/omM7sK8WRXg/object-sort-by-key-value-using-php.html" title="Object sort by Key value using PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/09/object-sort-by-key-value-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAARn8-cSp7ImA9WhdVFUU.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-6469943610599151160</id><published>2011-09-20T23:32:00.001-07:00</published><updated>2011-09-20T23:32:27.159-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-20T23:32:27.159-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Array sort by Key value using PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="Custom Sort function" /><title>Array sort by Key value using PHP</title><content type="html">/**&lt;br /&gt;
&amp;nbsp;Here is a function to sort an array by the key of his sub-array.&lt;br /&gt;
*/&lt;br /&gt;
function arraySort(&amp;amp;$array, $subkey="id", $sort_ascending=false) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (count($array))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $temp_array[key($array)] = array_shift($array);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($array as $key =&amp;gt; $val){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $offset = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $found = false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($temp_array as $tmp_key =&amp;gt; $tmp_val)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!$found and strtolower($val[$subkey]) &amp;gt; strtolower($tmp_val[$subkey]))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $temp_array = array_merge(&amp;nbsp;&amp;nbsp;&amp;nbsp; (array)array_slice($temp_array,0,$offset),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array($key =&amp;gt; $val),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array_slice($temp_array,$offset)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $found = true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $offset++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!$found) $temp_array = array_merge($temp_array, array($key =&amp;gt; $val));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($sort_ascending) $array = array_reverse($temp_array);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else $array = $temp_array;&lt;br /&gt;
}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-6469943610599151160?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Pdm8zGKXLktV_CXDnNS2lUQrBXY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pdm8zGKXLktV_CXDnNS2lUQrBXY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Pdm8zGKXLktV_CXDnNS2lUQrBXY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pdm8zGKXLktV_CXDnNS2lUQrBXY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/3VdbTmOEXvA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/6469943610599151160/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=6469943610599151160" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/6469943610599151160?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/6469943610599151160?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/3VdbTmOEXvA/array-sort-by-key-value-using-php.html" title="Array sort by Key value using PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/09/array-sort-by-key-value-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEHR38-cSp7ImA9WhdVFUw.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-3842390538177354442</id><published>2011-09-20T04:00:00.000-07:00</published><updated>2011-09-20T04:03:56.159-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-20T04:03:56.159-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Webservice" /><category scheme="http://www.blogger.com/atom/ns#" term="Webservice in SOAP using PHP" /><title>Webservice in SOAP using PHP</title><content type="html">&lt;u&gt;&lt;b&gt;What is SOAP?&lt;/b&gt;&lt;/u&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.w3.org/TR/soap12-part0/"&gt;SOAP&lt;/a&gt;,  the Simple Object Access Protocol, is the powerhouse of web services.  It’s a highly adaptable, object-oriented protocol that exists in over 80  implementations on every popular platform, including &lt;a href="http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/index.html"&gt;AppleScript&lt;/a&gt;,  JavaScript, and Cocoa. It provides a flexible communication layer  between applications, regardless of platform and location. As long as  they both speak SOAP, a PHP-based web application can ask a C++ database  application on another continent to look up the price of a book and  have the answer right away. Another &lt;a href="http://developer.apple.com/internet/applescript/applescripttoperl.html"&gt;Internet Developer article&lt;/a&gt; shows how to use SOAP with AppleScript and Perl.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;How SOAP works?&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
A SOAP transaction begins with an application making a call to a remote  procedure. The SOAP client script then encodes the procedure request as  an XML payload and sends it over the transport protocol to a server  script. The server parses the request and passes it to a local method,  which returns a response. The response is encoded as XML by the server  and returned as a response to the client, which parses the response and  passes the result to the original function.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;SOAP versionings?&lt;/b&gt;&lt;/u&gt; &lt;br /&gt;
&lt;br /&gt;
There are a number of different implementations of SOAP under PHP. It’s a  shifting landscape: new ones appear, and old ones aren’t maintained or  simply vanish. As of this writing, the most viable PHP implementation of  SOAP seems to be &lt;b&gt;Dietrich Ayala’s&lt;/b&gt; &lt;b&gt;SOAPx4&lt;/b&gt;, also known as &lt;u&gt;&lt;b&gt;NuSOAP&lt;/b&gt;&lt;/u&gt;. This  implementation is the most commonly used and appears to be the most  fully developed and actively maintained, and it shows every sign of  continuing to be a robust and popular solution. It’s not complete—a  number of features, including full documentation, are still in the  works—but it’s still a highly viable and easy-to-use SOAP solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-3842390538177354442?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fXkOM_HTyX7iWfifhD50wACKaao/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fXkOM_HTyX7iWfifhD50wACKaao/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fXkOM_HTyX7iWfifhD50wACKaao/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fXkOM_HTyX7iWfifhD50wACKaao/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/omAXouimToc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/3842390538177354442/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=3842390538177354442" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3842390538177354442?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3842390538177354442?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/omAXouimToc/webservice-in-soap-using-php.html" title="Webservice in SOAP using PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/09/webservice-in-soap-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QMQnw7fyp7ImA9WhdXE0k.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-7535912300487017158</id><published>2011-08-25T23:49:00.001-07:00</published><updated>2011-08-25T23:49:43.207-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-25T23:49:43.207-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google Finance API  Sample PHP Code" /><title>Google Finance API  Sample PHP Code</title><content type="html">&lt;!--?php&lt;br--&gt;/* Turn off notices for empty string values */&lt;br /&gt;
error_reporting(0);&lt;br /&gt;
&lt;br /&gt;
/* Get data from google */&lt;br /&gt;
$data = file_get_contents('http://finance.google.com/finance/info?client=ig&amp;amp;q=NSE:BIRLAPOWER');&lt;br /&gt;
&lt;br /&gt;
/* Strip first and last characters */&lt;br /&gt;
$data = substr($data,7,strlen($data)-7-4);&lt;br /&gt;
&lt;br /&gt;
/* Split data into name:value records */&lt;br /&gt;
$records = explode(',', $data);&lt;br /&gt;
&lt;br /&gt;
for($i = 0; $i &amp;lt; count($records); $i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;/* split record into record name ($pair[0]) and record value ($pair[1]) */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;$pair = explode(": ", $records[$i]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;/* do the output to be sure you got it right */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;echo 'Record name: ' . $pair[0] . ', Record value: ' . $pair[1] . '&lt;br /&gt;
';&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-7535912300487017158?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Wr1QDr0JANKEZiF4FGGe-ACKbm8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wr1QDr0JANKEZiF4FGGe-ACKbm8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Wr1QDr0JANKEZiF4FGGe-ACKbm8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wr1QDr0JANKEZiF4FGGe-ACKbm8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/JM4kuygSVzI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/7535912300487017158/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=7535912300487017158" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/7535912300487017158?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/7535912300487017158?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/JM4kuygSVzI/google-finance-api-sample-php-code.html" title="Google Finance API  Sample PHP Code" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/08/google-finance-api-sample-php-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUDSXk-eip7ImA9WhdQEEs.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-867037717916911983</id><published>2011-08-11T04:47:00.001-07:00</published><updated>2011-08-11T04:47:58.752-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-11T04:47:58.752-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Show / Hide Display errors in PHP" /><title>Show / Hide Display errors in PHP</title><content type="html">&lt;u&gt;&lt;b&gt;To Hide the Display errors:&lt;/b&gt;&lt;/u&gt; &lt;br /&gt;
&lt;br /&gt;
error_reporting(0);&lt;br /&gt;
ini_set('display_errors','Off');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-867037717916911983?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qOpigxpn3xCFOC4tLT0YIF2sp6k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qOpigxpn3xCFOC4tLT0YIF2sp6k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qOpigxpn3xCFOC4tLT0YIF2sp6k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qOpigxpn3xCFOC4tLT0YIF2sp6k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/TW7MqHOm4_c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/867037717916911983/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=867037717916911983" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/867037717916911983?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/867037717916911983?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/TW7MqHOm4_c/show-hide-display-errors-in-php.html" title="Show / Hide Display errors in PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/08/show-hide-display-errors-in-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ANQX86fip7ImA9WhdREko.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-8131840997890638668</id><published>2011-08-02T00:56:00.000-07:00</published><updated>2011-08-02T00:56:30.116-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-02T00:56:30.116-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="File Vs Function Vs Method Vs Extension Existance" /><title>PHP functions for checking the Existance.</title><content type="html">&lt;u&gt;&lt;b&gt;Function Existance:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
function_exists();&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Ex:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #007700;"&gt;if&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;function_exists&lt;/span&gt;&lt;span style="color: #007700;"&gt;(&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;'imap_open'&lt;/span&gt;&lt;span style="color: #007700;"&gt;))&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;"IMAP&amp;nbsp;functions&amp;nbsp;are&amp;nbsp;available.&lt;br&amp;nbsp;&gt;\n"&lt;/br&amp;nbsp;&gt;&lt;/span&gt;&lt;span style="color: #007700;"&gt;;&lt;br /&gt;
}&amp;nbsp;else&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;"IMAP&amp;nbsp;functions&amp;nbsp;are&amp;nbsp;not&amp;nbsp;available.&lt;br&amp;nbsp;&gt;\n"&lt;/br&amp;nbsp;&gt;&lt;/span&gt;&lt;span style="color: #007700;"&gt;;&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Method Existance:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="dc-title"&gt;Checks if the class method exists&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="html"&gt;&lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="default"&gt;ParentClass &lt;/span&gt;&lt;span class="keyword"&gt;{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; function &lt;/span&gt;&lt;span class="default"&gt;doParent&lt;/span&gt;&lt;span class="keyword"&gt;() { }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class &lt;/span&gt;&lt;span class="default"&gt;ChildClass &lt;/span&gt;&lt;span class="keyword"&gt;extends &lt;/span&gt;&lt;span class="default"&gt;ParentClass &lt;/span&gt;&lt;span class="keyword"&gt;{ }&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span class="default"&gt;$p &lt;/span&gt;&lt;span class="keyword"&gt;= new &lt;/span&gt;&lt;span class="default"&gt;ParentClass&lt;/span&gt;&lt;span class="keyword"&gt;();&lt;br /&gt;
&lt;/span&gt;&lt;span class="default"&gt;$c &lt;/span&gt;&lt;span class="keyword"&gt;= new &lt;/span&gt;&lt;span class="default"&gt;ChildClass&lt;/span&gt;&lt;span class="keyword"&gt;();&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span class="comment"&gt;// all return true&lt;br /&gt;
&lt;/span&gt;&lt;span class="default"&gt;var_dump&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;method_exists&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$p&lt;/span&gt;&lt;span class="keyword"&gt;, &lt;/span&gt;&lt;span class="string"&gt;'doParent'&lt;/span&gt;&lt;span class="keyword"&gt;));&lt;br /&gt;
&lt;/span&gt;&lt;span class="default"&gt;var_dump&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;method_exists&lt;/span&gt;&lt;span class="keyword"&gt;(&lt;/span&gt;&lt;span class="default"&gt;$c&lt;/span&gt;&lt;span class="keyword"&gt;, &lt;/span&gt;&lt;span class="string"&gt;'doParent'&lt;/span&gt;&lt;span class="keyword"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="html"&gt;&lt;span class="keyword"&gt;&lt;u&gt;&lt;b&gt;File Existance:&lt;/b&gt;&lt;/u&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="html"&gt;&lt;span class="keyword"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="dc-title"&gt;Checks whether a file or directory exists&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #0000bb;"&gt;$filename&amp;nbsp;&lt;/span&gt;&lt;span style="color: #007700;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;'/path/to/foo.txt'&lt;/span&gt;&lt;span style="color: #007700;"&gt;;&lt;br /&gt;
&lt;br /&gt;
if&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;file_exists&lt;/span&gt;&lt;span style="color: #007700;"&gt;(&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;$filename&lt;/span&gt;&lt;span style="color: #007700;"&gt;))&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;"The&amp;nbsp;file&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;$filename&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;&amp;nbsp;exists"&lt;/span&gt;&lt;span style="color: #007700;"&gt;;&lt;br /&gt;
}&amp;nbsp;else&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;"The&amp;nbsp;file&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;$filename&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;&amp;nbsp;does&amp;nbsp;not&amp;nbsp;exist"&lt;/span&gt;&lt;span style="color: #007700;"&gt;;&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code style="color: black;"&gt;&lt;u&gt;&lt;b&gt;Extension Existance:&lt;/b&gt;&lt;/u&gt;&amp;nbsp;&lt;/code&gt;&lt;span class="dc-title"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="dc-title"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="dc-title"&gt;Find out whether an extension is loaded&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #007700;"&gt;if&amp;nbsp;(!&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;extension_loaded&lt;/span&gt;&lt;span style="color: #007700;"&gt;(&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;'gd'&lt;/span&gt;&lt;span style="color: #007700;"&gt;))&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!&lt;/span&gt;&lt;span style="color: #0000bb;"&gt;dl&lt;/span&gt;&lt;span style="color: #007700;"&gt;(&lt;/span&gt;&lt;span style="color: #dd0000;"&gt;'gd.so'&lt;/span&gt;&lt;span style="color: #007700;"&gt;))&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span class="dc-title"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-8131840997890638668?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9sdmxDJjSUUYQfsF0DK3uBmqoVg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9sdmxDJjSUUYQfsF0DK3uBmqoVg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9sdmxDJjSUUYQfsF0DK3uBmqoVg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9sdmxDJjSUUYQfsF0DK3uBmqoVg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/bS-hL5WUvjI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/8131840997890638668/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=8131840997890638668" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8131840997890638668?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8131840997890638668?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/bS-hL5WUvjI/php-functions-for-checking-existance.html" title="PHP functions for checking the Existance." /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/08/php-functions-for-checking-existance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQFQ3ozeSp7ImA9WhZaEkk.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-4107286218666344594</id><published>2011-06-28T00:48:00.000-07:00</published><updated>2011-06-28T00:48:32.481-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-28T00:48:32.481-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Validating Multiple Checkbox with example" /><title>Validating Multiple Checkbox with example</title><content type="html">&amp;lt; ? for(..)?&amp;gt; &lt;br /&gt;
&amp;nbsp; &amp;lt; input type="checkbox" name="couponlist[]" value="couponId;?&amp;gt;" &amp;gt; &lt;br /&gt;
&amp;lt; ? }?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Validation Script:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
function validateRemove() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var chk = document.getElementsByName('couponlist[]');&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var len = chk.length;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var flag = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0; i &amp;lt; len; i++) {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(&amp;nbsp;&amp;nbsp;&amp;nbsp; chk[i].checked == true ){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; flag = 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(flag == 1) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(confirm('Are you sure you want to remove selected coupons')){ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; document.forms.couponlist.submit(); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alert('Select atleast one coupon to remove');&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-4107286218666344594?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LTsiHcUzuAGBRYMrdihoRp4_jok/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LTsiHcUzuAGBRYMrdihoRp4_jok/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LTsiHcUzuAGBRYMrdihoRp4_jok/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LTsiHcUzuAGBRYMrdihoRp4_jok/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/nRsVBOlxMNk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/4107286218666344594/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=4107286218666344594" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/4107286218666344594?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/4107286218666344594?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/nRsVBOlxMNk/validating-multiple-checkbox-with.html" title="Validating Multiple Checkbox with example" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/06/validating-multiple-checkbox-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08HQn0yfyp7ImA9WhZbEU4.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-1556983079692108094</id><published>2011-06-15T04:03:00.000-07:00</published><updated>2011-06-15T04:03:53.397-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-15T04:03:53.397-07:00</app:edited><title>Enabled drupal modules are showing as not enabled</title><content type="html">Sometime this kind of problems will occur in drupal admin.  At that time, we need to add the below line at the end of &lt;b&gt;&lt;i&gt;my.ini&lt;/i&gt;&lt;/b&gt; file to solve this problem.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
max_allowed_packet = 32M&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
Step 1: paste the above line at the end of &lt;b&gt;&lt;i&gt;my.ini&lt;/i&gt;&lt;/b&gt; file&lt;br /&gt;
Step 2: restart your apache&lt;br /&gt;
Step 3: Check it and Enjoy&lt;br /&gt;
Step 4: if you are not an administrator user in your windows system, then you cant restart your apache, for that case you need to restart your windows system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-1556983079692108094?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XtYif5_vKWwPPkBctOrM6HfkVhg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XtYif5_vKWwPPkBctOrM6HfkVhg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XtYif5_vKWwPPkBctOrM6HfkVhg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XtYif5_vKWwPPkBctOrM6HfkVhg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/csVqkWdVxsI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/1556983079692108094/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=1556983079692108094" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1556983079692108094?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1556983079692108094?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/csVqkWdVxsI/enabled-drupal-modules-are-showing-as.html" title="Enabled drupal modules are showing as not enabled" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/06/enabled-drupal-modules-are-showing-as.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcBQXo4fyp7ImA9WhZUFk8.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-8061701991310889332</id><published>2011-06-09T06:44:00.000-07:00</published><updated>2011-06-09T06:44:10.437-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-09T06:44:10.437-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Regular Expression" /><title>Regular Expression with Different Validations</title><content type="html">Regular expression examples for decimals input&lt;br /&gt;
&lt;br /&gt;
Positive Integers --- ^\d+$&lt;br /&gt;
Negative Integers --- ^-\d+$&lt;br /&gt;
Integer --- ^-{0,1}\d+$&lt;br /&gt;
Positive Number --- ^\d*\.{0,1}\d+$&lt;br /&gt;
Negative Number --- ^-\d*\.{0,1}\d+$&lt;br /&gt;
Positive Number or Negative Number - ^-{0,1}\d*\.{0,1}\d+$&lt;br /&gt;
Phone number --- ^\+?[\d\s]{3,}$&lt;br /&gt;
Phone with code --- ^\+?[\d\s]+\(?[\d\s]{10,}$&lt;br /&gt;
Year 1900-2099 --- ^(19|20)[\d]{2,2}$&lt;br /&gt;
Date (dd mm yyyy, d/m/yyyy, etc.) --- ^([1-9]|0[1-9]|[12][0-9]|3[01])\D([1-9]|0[1-9]|1[012])\D(19[0-9][0-9]|20[0-9][0-9])$&lt;br /&gt;
IP v4 --- ^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]){3}$&lt;br /&gt;
&lt;br /&gt;
Regular expression examples for Alphabetic input&lt;br /&gt;
&lt;br /&gt;
Personal Name --- ^[\w\.\']{2,}([\s][\w\.\']{2,})+$&lt;br /&gt;
Username --- ^[\w\d\_\.]{4,}$&lt;br /&gt;
Password at least 6 symbols --- ^.{6,}$&lt;br /&gt;
Password or empty input --- ^.{6,}$|^$&lt;br /&gt;
email --- ^[\_]*([a-z0-9]+(\.|\_*)?)+@([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$&lt;br /&gt;
domain --- ^([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$&lt;br /&gt;
&lt;br /&gt;
Other regular expressions&lt;br /&gt;
Match no input --- ^$&lt;br /&gt;
Match blank input --- ^\s[\t]*$&lt;br /&gt;
Match New line --- [\r\n]|$&lt;br /&gt;
&lt;br /&gt;
Please, report any bugs to the author.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-8061701991310889332?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0_3v3520F19LmZbfMUqGSvbJ6dg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0_3v3520F19LmZbfMUqGSvbJ6dg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0_3v3520F19LmZbfMUqGSvbJ6dg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0_3v3520F19LmZbfMUqGSvbJ6dg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/8m8OogeO5Zo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/8061701991310889332/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=8061701991310889332" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8061701991310889332?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8061701991310889332?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/8m8OogeO5Zo/regular-expression-with-different.html" title="Regular Expression with Different Validations" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/06/regular-expression-with-different.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IMR3cyeCp7ImA9WhZUFEg.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-6604530533411225865</id><published>2011-06-07T05:59:00.000-07:00</published><updated>2011-06-07T05:59:46.990-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-07T05:59:46.990-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MySQL" /><category scheme="http://www.blogger.com/atom/ns#" term="MySQL INDEX" /><title>Purpose of MySQL INDEX with Example</title><content type="html">&lt;b&gt;MySQL Indexes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Using INDEX we can search and fetch the data from the table like getting a chapter or specific information from a book INDEX.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
An index can be created in a table to find data more quickly and efficiently.&lt;br /&gt;
&lt;br /&gt;
The users cannot see the indexes, they are just used to speed up searches/queries.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Note:&lt;/i&gt; Updating a table with indexes takes more time than updating a table without (because the indexes also need an update). So you should only create indexes on columns (and tables) that will be frequently searched against.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
SQL CREATE INDEX Syntax&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Creates an index on a table. Duplicate values are allowed:&lt;br /&gt;
CREATE INDEX index_name ON table_name (column_name)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
SQL CREATE UNIQUE INDEX Syntax&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Creates a unique index on a table. Duplicate values are not allowed:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CREATE UNIQUE INDEX index_name ON table_name (column_name)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Note: The syntax for creating indexes varies amongst different databases. Therefore: Check the syntax for creating indexes in your database.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CREATE INDEX Example&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The SQL statement below creates an index named "LastnameIndex" on the "LastName" column in the "Persons" table:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
CREATE INDEX LastnameIndex ON Persons (LastName)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;If you want to create an index on a combination of columns&lt;/i&gt;, you can list the column names within the parentheses, separated by commas:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CREATE INDEX LastandFirstnameIndex ON Persons (LastName, FirstName)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How MySQL Uses Indexes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Purpose of MySQL Index&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Without INDEX:&lt;/b&gt;&lt;br /&gt;
If the number of records in a table is very less, then there is no need of using INDEX for a field in a table. Without INDEX also it will work very fast with less records table.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;With INDEX:&lt;/b&gt;&lt;br /&gt;
If we want to know the real purpose of the MySQL INDEX when the records is more  than 1000 records (say for example). Our system will get slow to fetch the records.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;We can solve this problem by using several methods like:&lt;/i&gt;&lt;br /&gt;
a. Increase the memory_limit in our server&lt;br /&gt;
b. Increase the maximum_execution_time in our server&lt;br /&gt;
c. Optimize the Query like fetching the appropriate fields instead of Select * from ... etc..&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;But,&lt;/b&gt; We cant increase our System performance. So, now the time to introduce INDEX.&lt;br /&gt;
&lt;br /&gt;
The performance of the table is really improve when using INDEX.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-6604530533411225865?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qDRcFUw8XbhO67cRIYAGKCl_EZI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qDRcFUw8XbhO67cRIYAGKCl_EZI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qDRcFUw8XbhO67cRIYAGKCl_EZI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qDRcFUw8XbhO67cRIYAGKCl_EZI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/BKPG4I-zEWI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/6604530533411225865/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=6604530533411225865" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/6604530533411225865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/6604530533411225865?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/BKPG4I-zEWI/purpose-of-mysql-index-with-example.html" title="Purpose of MySQL INDEX with Example" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/06/purpose-of-mysql-index-with-example.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8BQn8_fCp7ImA9WhZUFkw.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-5965493528805881609</id><published>2011-06-07T05:24:00.000-07:00</published><updated>2011-06-09T03:04:13.144-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-09T03:04:13.144-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Regular Expression" /><title>Regular Expressions - User Guide</title><content type="html">&lt;b&gt;Simple Matching&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
::Example:: &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;STRING1   Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)&lt;br /&gt;
STRING2   Mozilla/4.75 [en](X11;U;Linux2.2.16-22 i586)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Search for&lt;br /&gt;
&lt;br /&gt;
m  &lt;br /&gt;
STRING1  match  Finds the m in compatible&lt;br /&gt;
STRING2  no match  There is no lower case m in this string. Searches are case sensitive unless you take special action.&lt;br /&gt;
&lt;br /&gt;
a/4  &lt;br /&gt;
STRING1  match  Found in Mozilla/4.0 - any combination of characters can be used for the match&lt;br /&gt;
STRING2  match  Found in same place as in STRING1&lt;br /&gt;
&lt;br /&gt;
5 [  &lt;br /&gt;
STRING1  no match  The search is looking for a pattern of '5 [' and this does NOT exist in STRING1. Spaces are valid in searches.&lt;br /&gt;
STRING2  match  Found in Mozilla/4.75 [en]&lt;br /&gt;
&lt;br /&gt;
in  &lt;br /&gt;
STRING1  match  found in Windows&lt;br /&gt;
STRING2  match  Found in Linux&lt;br /&gt;
&lt;br /&gt;
le &lt;br /&gt;
STRING1  match  found in compatible&lt;br /&gt;
STRING2  no match  There is an l and an e in this string but they are not adjacent (or contiguous).&lt;br /&gt;
&lt;br /&gt;
[ ] &lt;br /&gt;
&lt;br /&gt;
Match anything inside the square brackets for ONE character position once and only once, for example, [12] means match the target to 1 and if that does not match then match the target to 2 while [0123456789] means match to any character in the range 0 to 9.&lt;br /&gt;
&lt;br /&gt;
-  &lt;br /&gt;
&lt;br /&gt;
The - (dash) inside square brackets is the 'range separator' and allows us to define a range, in our example above of [0123456789] we could rewrite it as [0-9].&lt;br /&gt;
&lt;br /&gt;
You can define more than one range inside a list, for example, [0-9A-C] means check for 0 to 9 and A to C (but not a to c).&lt;br /&gt;
&lt;br /&gt;
NOTE: To test for - inside brackets (as a literal) it must come first or last, that is, [-0-9] will test for - and 0 to 9.&lt;br /&gt;
&lt;br /&gt;
^  &lt;br /&gt;
&lt;br /&gt;
The ^ (circumflex or caret) inside square brackets negates the expression (we will see an alternate use for the circumflex/caret outside square brackets later), for example, [^Ff] means anything except upper or lower case F and [^a-z] means everything except lower case a to z.&lt;br /&gt;
&lt;br /&gt;
in[du]  &lt;br /&gt;
STRING1  match  finds ind in Windows&lt;br /&gt;
STRING2  match  finds inu in Linux&lt;br /&gt;
&lt;br /&gt;
x[0-9A-Z]  &lt;br /&gt;
STRING1  no match  Again the tests are case sensitive to find the xt in DigExt we would need to use [0-9a-z] or [0-9A-Zt]. We can also use this format for testing upper and lower case e.g. [Ff] will check for lower and upper case F.&lt;br /&gt;
STRING2  match  Finds x2 in Linux2&lt;br /&gt;
&lt;br /&gt;
[^A-M]in  &lt;br /&gt;
STRING1  match  Finds Win in Windows&lt;br /&gt;
STRING2  no match  We have excluded the range A to M in our search so Linux is not found but linux (if it were present) would be found.&lt;br /&gt;
&lt;br /&gt;
?  &lt;br /&gt;
&lt;br /&gt;
The ? (question mark) matches the preceding character 0 or 1 times only, for example, colou?r will find both color (0 times) and colour (1 time).&lt;br /&gt;
&lt;br /&gt;
*  &lt;br /&gt;
&lt;br /&gt;
The * (asterisk or star) matches the preceding character 0 or more times, for example, tre* will find tree (2 times) and tread (1 time) and trough (0 times).&lt;br /&gt;
&lt;br /&gt;
+  &lt;br /&gt;
&lt;br /&gt;
The + (plus) matches the previous character 1 or more times, for example, tre+ will find tree (2 times) and tread (1 time) but not trough (0 times).&lt;br /&gt;
&lt;br /&gt;
{n}  &lt;br /&gt;
&lt;br /&gt;
Matches the preceding character, or character range, n times exactly, for example, to find a local phone number we could use [0-9]{3}-[0-9]{4} which would find any number of the form 123-4567.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-5965493528805881609?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/us_PPFfOXsFoTbeM639eYcdVDFQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/us_PPFfOXsFoTbeM639eYcdVDFQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/us_PPFfOXsFoTbeM639eYcdVDFQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/us_PPFfOXsFoTbeM639eYcdVDFQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/3US2KN9ghgU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/5965493528805881609/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=5965493528805881609" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/5965493528805881609?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/5965493528805881609?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/3US2KN9ghgU/regular-expressions-user-guide.html" title="Regular Expressions - User Guide" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/06/regular-expressions-user-guide.html</feedburner:origLink><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://feedproxy.google.com/~r/blogspot/KEpx/~5/BT-eBTB-DgM/regex.htm" length="0" type="text/html" /><feedburner:origEnclosureLink>http://www.zytrax.com/tech/web/regex.htm</feedburner:origEnclosureLink></entry><entry gd:etag="W/&quot;D0MNQXw_eip7ImA9WhZUFEk.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-7537649966539999386</id><published>2011-06-07T04:18:00.000-07:00</published><updated>2011-06-07T04:18:10.242-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-07T04:18:10.242-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Regular Expression" /><title>Regular Expression in PHP with Examples</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
What is a Regular Expression?&lt;br /&gt;
&lt;br /&gt;
A regular expression is a set of characters that specify a pattern. The term "regular" has nothing to do with a high-fiber diet. It comes from a term used to describe grammars and formal languages.&lt;br /&gt;
&lt;br /&gt;
Regular expressions are used when you want to search for specify lines of text containing a particular pattern. Most of the UNIX utilities operate on ASCII files a line at a time. Regular expressions search for patterns on a single line, and not for patterns that start on one line and end on another.&lt;br /&gt;
&lt;br /&gt;
It is simple to search for a specific word or string of characters. Almost every editor on every computer system can do this. Regular expressions are more powerful and flexible. You can search for words of a certain size. You can search for a word with four or more vowels that end with an "s". Numbers, punctuation characters, you name it, a regular expression can find it. What happens once the program you are using find it is another matter. Some just search for the pattern. Others print out the line containing the pattern. Editors can replace the string with a new pattern. It all depends on the utility.&lt;br /&gt;
&lt;br /&gt;
Regular expressions confuse people because they look a lot like the file matching patterns the shell uses. They even act the same way--almost. The square brackers are similar, and the asterisk acts similar to, but not identical to the asterisk in a regular expression. In particular, the Bourne shell, C shell, find, and cpio use file name matching patterns and not regular expressions.&lt;br /&gt;
&lt;br /&gt;
Remember that shell meta-characters are expanded before the shell passes the arguments to the program. To prevent this expansion, the special characters in a regular expression must be quoted when passed as an option from the shell. You already know how to do this because I covered this topic in last month's tutorial.&lt;br /&gt;
&lt;br /&gt;
The Structure of a Regular Expression&lt;br /&gt;
&lt;br /&gt;
There are three important parts to a regular expression. Anchors are used to specify the position of the pattern in relation to a line of text. Character Sets match one or more characters in a single position. Modifiers specify how many times the previous character set is repeated. A simple example that demonstrates all three parts is the regular expression "^#*". The up arrow is an anchor that indicates the beginning of the line. The character "#" is a simple character set that matches the single character "#". The asterisk is a modifier. In a regular expression it specifies that the previous character set can appear any number of times, including zero. This is a useless regular expression, as you will see shortly.&lt;br /&gt;
&lt;br /&gt;
There are also two types of regular expressions: the "Basic" regular expression, and the "extended" regular expression. A few utilities like awk and egrep use the extended expression. Most use the "regular" regular expression. From now on, if I talk about a "regular expression," it describes a feature in both types.&lt;br /&gt;
&lt;br /&gt;
Here is a table of the Solaris (around 1991) commands that allow you to specify regular expressions:&lt;br /&gt;
Utility  Regular Expression Type&lt;br /&gt;
vi  Basic&lt;br /&gt;
sed  Basic&lt;br /&gt;
grep  Basic&lt;br /&gt;
csplit  Basic&lt;br /&gt;
dbx  Basic&lt;br /&gt;
dbxtool  Basic&lt;br /&gt;
more  Basic&lt;br /&gt;
ed  Basic&lt;br /&gt;
expr  Basic&lt;br /&gt;
lex  Basic&lt;br /&gt;
pg  Basic&lt;br /&gt;
nl  Basic&lt;br /&gt;
rdist  Basic&lt;br /&gt;
awk  Extended&lt;br /&gt;
nawk  Extended&lt;br /&gt;
egrep  Extended&lt;br /&gt;
EMACS  EMACS Regular Expressions&lt;br /&gt;
PERL  PERL Regular Expressions&lt;br /&gt;
&lt;br /&gt;
The Anchor Characters: ^ and $&lt;br /&gt;
&lt;br /&gt;
Most UNIX text facilities are line oriented. Searching for patterns that span several lines is not easy to do. You see, the end of line character is not included in the block of text that is searched. It is a separator. Regular expressions examine the text between the separators. If you want to search for a pattern that is at one end or the other, you use anchors. The character "^" is the starting anchor, and the character "$" is the end anchor. The regular expression "^A" will match all lines that start with a capital A. The expression "A$" will match all lines that end with the capital A. If the anchor characters are not used at the proper end of the pattern, then they no longer act as anchors. That is, the "^" is only an anchor if it is the first character in a regular expression. The "$" is only an anchor if it is the last character. The expression "$1" does not have an anchor. Neither is "1^". If you need to match a "^" at the beginning of the line, or a "$" at the end of a line, you must escape the special characters with a backslash. Here is a summary:&lt;br /&gt;
Pattern  Matches&lt;br /&gt;
^A  "A" at the beginning of a line&lt;br /&gt;
A$  "A" at the end of a line&lt;br /&gt;
A^  "A^" anywhere on a line&lt;br /&gt;
$A  "$A" anywhere on a line&lt;br /&gt;
^^  "^" at the beginning of a line&lt;br /&gt;
$$  "$" at the end of a line&lt;br /&gt;
&lt;br /&gt;
The use of "^" and "$" as indicators of the beginning or end of a line is a convention other utilities use. The vi editor uses these two characters as commands to go to the beginning or end of a line. The C shell uses "!^" to specify the first argument of the previous line, and "!$" is the last argument on the previous line.&lt;br /&gt;
&lt;br /&gt;
It is one of those choices that other utilities go along with to maintain consistancy. For instance, "$" can refer to the last line of a file when using ed and sed. Cat -e marks end of lines with a "$". You might see it in other programs as well.&lt;br /&gt;
&lt;br /&gt;
Matching a character with a character set&lt;br /&gt;
&lt;br /&gt;
The simplest character set is a character. The regular expression "the" contains three character sets: "t," "h" and "e". It will match any line with the string "the" inside it. This would also match the word "other". To prevent this, put spaces before and after the pattern: " the ". You can combine the string with an anchor. The pattern "^From: " will match the lines of a mail message that identify the sender. Use this pattern with grep to print every address in your incoming mail box:&lt;br /&gt;
&lt;br /&gt;
    grep '^From: ' /usr/spool/mail/$USER&lt;br /&gt;
&lt;br /&gt;
Some characters have a special meaning in regular expressions. If you want to search for such a character, escape it with a backslash.&lt;br /&gt;
&lt;br /&gt;
Match any character with .&lt;br /&gt;
&lt;br /&gt;
The character "." is one of those special meta-characters. By itself it will match any character, except the end-of-line character. The pattern that will match a line with a single characters is&lt;br /&gt;
&lt;br /&gt;
    ^.$&lt;br /&gt;
&lt;br /&gt;
Specifying a Range of Characters with [...]&lt;br /&gt;
&lt;br /&gt;
If you want to match specific characters, you can use the square brackets to identify the exact characters you are searching for. The pattern that will match any line of text that contains exactly one number is&lt;br /&gt;
&lt;br /&gt;
    ^[0123456789]$&lt;br /&gt;
&lt;br /&gt;
This is verbose. You can use the hyphen between two characters to specify a range:&lt;br /&gt;
&lt;br /&gt;
    ^[0-9]$&lt;br /&gt;
&lt;br /&gt;
You can intermix explicit characters with character ranges. This pattern will match a single character that is a letter, number, or underscore:&lt;br /&gt;
&lt;br /&gt;
    [A-Za-z0-9_]&lt;br /&gt;
&lt;br /&gt;
Character sets can be combined by placing them next to each other. If you wanted to search for a word that&lt;br /&gt;
&lt;br /&gt;
   1. Started with a capital letter "T".&lt;br /&gt;
   2. Was the first word on a line&lt;br /&gt;
   3. The second letter was a lower case letter&lt;br /&gt;
   4. Was exactly three letters long, and&lt;br /&gt;
   5. The third letter was a vowel &lt;br /&gt;
&lt;br /&gt;
the regular expression would be "^T[a-z][aeiou] ".&lt;br /&gt;
&lt;br /&gt;
Exceptions in a character set&lt;br /&gt;
&lt;br /&gt;
You can easily search for all characters except those in square brackets by putting a "^" as the first character after the "[". To match all characters except vowels use "[^aeiou]".&lt;br /&gt;
&lt;br /&gt;
Like the anchors in places that can't be considered an anchor, the characters "]" and "-" do not have a special meaning if they directly follow "[". Here are some examples:&lt;br /&gt;
Regular Expression  Matches&lt;br /&gt;
[]  The characters "[]"&lt;br /&gt;
[0]  The character "0"&lt;br /&gt;
[0-9]  Any number&lt;br /&gt;
[^0-9]  Any character other than a number&lt;br /&gt;
[-0-9]  Any number or a "-"&lt;br /&gt;
[0-9-]  Any number or a "-"&lt;br /&gt;
[^-0-9]  Any character except a number or a "-"&lt;br /&gt;
[]0-9]  Any number or a "]"&lt;br /&gt;
[0-9]]  Any number followed by a "]"&lt;br /&gt;
[0-9-z]  Any number,&lt;br /&gt;
 or any character between "9" and "z".&lt;br /&gt;
[0-9\-a\]]  Any number, or&lt;br /&gt;
 a "-", a "a", or a "]"&lt;br /&gt;
&lt;br /&gt;
Repeating character sets with *&lt;br /&gt;
&lt;br /&gt;
The third part of a regular expression is the modifier. It is used to specify how may times you expect to see the previous character set. The special character "*" matches zero or more copies. That is, the regular expression "0*" matches zero or more zeros, while the expression "[0-9]*" matches zero or more numbers.&lt;br /&gt;
&lt;br /&gt;
This explains why the pattern "^#*" is useless, as it matches any number of "#'s" at the beginning of the line, including zero. Therefore this will match every line, because every line starts with zero or more "#'s".&lt;br /&gt;
&lt;br /&gt;
At first glance, it might seem that starting the count at zero is stupid. Not so. Looking for an unknown number of characters is very important. Suppose you wanted to look for a number at the beginning of a line, and there may or may not be spaces before the number. Just use "^ *" to match zero or more spaces at the beginning of the line. If you need to match one or more, just repeat the character set. That is, "[0-9]*" matches zero or more numbers, and "[0-9][0-9]*" matches one or more numbers.&lt;br /&gt;
&lt;br /&gt;
Matching a specific number of sets with \{ and \}&lt;br /&gt;
&lt;br /&gt;
You can continue the above technique if you want to specify a minimum number of character sets. You cannot specify a maximum number of sets with the "*" modifier. There is a special pattern you can use to specify the minimum and maximum number of repeats. This is done by putting those two numbers between "\{" and "\}". The backslashes deserve a special discussion. Normally a backslash turns off the special meaning for a character. A period is matched by a "\." and an asterisk is matched by a "\*".&lt;br /&gt;
&lt;br /&gt;
If a backslash is placed before a "&lt;," "&gt;," "{," "}," "(," ")," or before a digit, the backslash turns on a special meaning. This was done because these special functions were added late in the life of regular expressions. Changing the meaning of "{" would have broken old expressions. This is a horrible crime punishable by a year of hard labor writing COBOL programs. Instead, adding a backslash added functionality without breaking old programs. Rather than complain about the unsymmetry, view it as evolution.&lt;br /&gt;
&lt;br /&gt;
Having convinced you that "\{" isn't a plot to confuse you, an example is in order. The regular expression to match 4, 5, 6, 7 or 8 lower case letters is&lt;br /&gt;
&lt;br /&gt;
    [a-z]\{4,8\}&lt;br /&gt;
&lt;br /&gt;
Any numbers between 0 and 255 can be used. The second number may be omitted, which removes the upper limit. If the comma and the second number are omitted, the pattern must be duplicated the exact number of times specified by the first number.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-7537649966539999386?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uSVnXNHUKGdUSIXxrOsY57eh5Yk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uSVnXNHUKGdUSIXxrOsY57eh5Yk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uSVnXNHUKGdUSIXxrOsY57eh5Yk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uSVnXNHUKGdUSIXxrOsY57eh5Yk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/Jx-ZLR5sp0c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/7537649966539999386/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=7537649966539999386" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/7537649966539999386?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/7537649966539999386?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/Jx-ZLR5sp0c/regular-expression-in-php-with-examples.html" title="Regular Expression in PHP with Examples" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/06/regular-expression-in-php-with-examples.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQn48fSp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-8945185297025490117</id><published>2011-05-12T06:34:00.000-07:00</published><updated>2011-05-13T13:27:13.075-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.075-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Objects and References</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Objects and references &lt;br /&gt;
One of the key-points of PHP5 OOP that is often mentioned is that "objects are passed by references by &lt;br /&gt;
default". This is not completely true. This section rectifies that general thought using some examples. &lt;br /&gt;
A PHP reference is an alias, which allows two different variables to write to the same value. As of&lt;br /&gt;
PHP5, an object variable doesn't contain the object itself as value anymore. It only contains an object&lt;br /&gt;
identifier which allows object accessors to find the actual object. When an object is sent by argument,&lt;br /&gt;
returned or assigned to another variable, the different variables are not aliases: they hold a copy of the&lt;br /&gt;
identifier, which points to the same object.&lt;br /&gt;
&lt;br /&gt;
$b-&amp;gt;foo= 2; &lt;br /&gt;
echo $a-&amp;gt;foo."\n"; &lt;br /&gt;
$c = new A; &lt;br /&gt;
$d= &amp;amp;$c; &lt;br /&gt;
// $c and $d are references &lt;br /&gt;
// ($c,$d) = &amp;lt; id &amp;gt; &lt;br /&gt;
$d-&amp;gt;foo= 2; &lt;br /&gt;
echo$c-&amp;gt;foo."\n"; &lt;br /&gt;
$e = new A; &lt;br /&gt;
functionfoo($obj) { &lt;br /&gt;
// ($obj) = ($e) = &amp;lt; id &amp;gt; &lt;br /&gt;
$obj-&amp;gt;foo= 2; &lt;br /&gt;
}foo($e); &lt;br /&gt;
echo$e-&amp;gt;foo."\n"; &lt;br /&gt;
?&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-8945185297025490117?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/o1PEwiTEwYiSxWKBDcLowlSpRbM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o1PEwiTEwYiSxWKBDcLowlSpRbM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/o1PEwiTEwYiSxWKBDcLowlSpRbM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o1PEwiTEwYiSxWKBDcLowlSpRbM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/Az27lnkwkj4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/8945185297025490117/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=8945185297025490117" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8945185297025490117?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8945185297025490117?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/Az27lnkwkj4/objects-and-references.html" title="Objects and References" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/objects-and-references.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQn45eyp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-8491724313871982676</id><published>2011-05-12T06:32:00.000-07:00</published><updated>2011-05-13T13:27:13.023-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.023-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Type Hinting</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Type Hinting &lt;br /&gt;
PHP 5 introduces Type Hinting. Functions are now able to force parameters to be objects (by&lt;br /&gt;
specifying the name of the class in the function prototype) or arrays (since PHP 5.1). However, if&lt;br /&gt;
NULL is used as the default parameter value, it will be allowed as an argument for any later call.&lt;br /&gt;
&lt;?php 
// An example class 
classMyClass 
{ 
/**
* A test function
** First parameter must be an object of type OtherClass
*/ 
public functiontest(OtherClass $otherclass) { 
echo$otherclass-&gt;var; &lt;br /&gt;
}/** &lt;br /&gt;
* Another test function &lt;br /&gt;
** First parameter must be an array &lt;br /&gt;
*/ &lt;br /&gt;
public functiontest_array(array$input_array) { &lt;br /&gt;
print_r($input_array); &lt;br /&gt;
} &lt;br /&gt;
}// Another example class &lt;br /&gt;
classOtherClass { &lt;br /&gt;
public$var = 'Hello World'; &lt;br /&gt;
}?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-8491724313871982676?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cvIJo39SMjf3_OaVfixrq6oGcZI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cvIJo39SMjf3_OaVfixrq6oGcZI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cvIJo39SMjf3_OaVfixrq6oGcZI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cvIJo39SMjf3_OaVfixrq6oGcZI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/oxJRXpZSOQE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/8491724313871982676/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=8491724313871982676" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8491724313871982676?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/8491724313871982676?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/oxJRXpZSOQE/type-hinting.html" title="Type Hinting" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/type-hinting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQn0-fSp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-7997804662592821364</id><published>2011-05-12T06:31:00.001-07:00</published><updated>2011-05-13T13:27:13.355-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.355-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Final Keyword</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Final Keyword &lt;br /&gt;
PHP 5 introduces the final keyword, which prevents child classes from overriding a method by &lt;br /&gt;
prefixing the definition with final. If the class itself is being defined final then it cannot be extended. &lt;br /&gt;
&lt;?php 
classBaseClass { 
public functiontest() { 
echo "BaseClass::test() called\n"; 
}final public functionmoreTesting() { 
echo "BaseClass::moreTesting() called\n"; 
} 
}classChildClass extendsBaseClass { 
public functionmoreTesting() { 
echo "ChildClass::moreTesting() called\n"; 
} 
}// Results in Fatal error: Cannot override final method BaseClass::mo 
reTesting() 
?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-7997804662592821364?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gNKbjXAceQ6eZNvKnvpWm78SfKA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gNKbjXAceQ6eZNvKnvpWm78SfKA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gNKbjXAceQ6eZNvKnvpWm78SfKA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gNKbjXAceQ6eZNvKnvpWm78SfKA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/Z3TeHGUDevY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/7997804662592821364/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=7997804662592821364" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/7997804662592821364?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/7997804662592821364?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/Z3TeHGUDevY/final-keyword.html" title="Final Keyword" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/final-keyword.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQ3c6fSp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-5935487902751967788</id><published>2011-05-12T06:31:00.000-07:00</published><updated>2011-05-13T13:27:12.915-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:12.915-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Object Cloning</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Object Cloning &lt;br /&gt;
Creating a copy of an object with fully replicated properties is not always the wanted behavior. A good&lt;br /&gt;
example of the need for copy constructors, is if you have an object which represents a GTK window&lt;br /&gt;
and the object holds the resource of this GTK window, when you create a duplicate you might want to&lt;br /&gt;
create a new window with the same properties and have the new object hold the resource of the new&lt;br /&gt;
window. Another example is if your object holds a reference to another object which it uses and when&lt;br /&gt;
you replicate the parent object you want to create a new instance of this other object so that the replica&lt;br /&gt;
has its own separate copy.&lt;br /&gt;
An object copy is created by using the clone keyword (which calls the object's __clone() method if &lt;br /&gt;
possible). An object's __clone() method cannot be called directly. &lt;br /&gt;
$copy_of_object = clone $object; &lt;br /&gt;
When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties. Any &lt;br /&gt;
properties that are references to other variables, will remain references. &lt;br /&gt;
Once the cloning is complete, if a __clone() method is defined, then the newly created object's &lt;br /&gt;
__clone() method will be called, to allow any necessary properties that need to be changed. &lt;br /&gt;
&lt;?php 
classSubObject 
{
static$instances =0;
public$instance;
public function__construct() { 
$this-&gt;instance = ++self::$instances; &lt;br /&gt;
}public function__clone() { &lt;br /&gt;
$this-&gt;instance = ++self::$instances; &lt;br /&gt;
} &lt;br /&gt;
}classMyCloneable &lt;br /&gt;
{&lt;br /&gt;
public$object1;&lt;br /&gt;
public$object2;&lt;br /&gt;
function__clone() &lt;br /&gt;
{ &lt;br /&gt;
// Force a copy of this-&gt;object, otherwise &lt;br /&gt;
// it will point to same object. &lt;br /&gt;
$this-&gt;object1 = clone $this-&gt;object1; &lt;br /&gt;
} &lt;br /&gt;
}$obj = new MyCloneable(); &lt;br /&gt;
$obj-&gt;object1 = new SubObject(); &lt;br /&gt;
$obj-&gt;object2 = new SubObject(); &lt;br /&gt;
$obj2 = clone $obj; &lt;br /&gt;
print("Original Object:\n"); &lt;br /&gt;
print_r($obj); &lt;br /&gt;
print("Cloned Object:\n"); &lt;br /&gt;
print_r($obj2); &lt;br /&gt;
?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-5935487902751967788?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aj9-B-04SuCTQltwW01bsLLZ1Kg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aj9-B-04SuCTQltwW01bsLLZ1Kg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aj9-B-04SuCTQltwW01bsLLZ1Kg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aj9-B-04SuCTQltwW01bsLLZ1Kg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/yxJDT2UfulA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/5935487902751967788/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=5935487902751967788" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/5935487902751967788?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/5935487902751967788?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/yxJDT2UfulA/object-cloning.html" title="Object Cloning" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/object-cloning.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQnw6fSp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-1368468215963891525</id><published>2011-05-12T06:30:00.000-07:00</published><updated>2011-05-13T13:27:13.215-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.215-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Patterns in PHP</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Patterns &lt;br /&gt;
Patterns are ways to describe best practices and good designs. They show a flexible solution to &lt;br /&gt;
common programming problems. &lt;br /&gt;
Factory &lt;br /&gt;
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;?php 
classExample 
{ 
// The parameterized factory method 
public static functionfactory($type) 
{ 
if (include_once'Drivers/' .$type .'.php') { 
$classname= 'Driver_' . $type; 
return new$classname; 
} else { 
throw newException ('Driver not found'); 
} 
} 
}?&gt; &lt;br /&gt;
Singleton &lt;br /&gt;
The Singleton pattern applies to situations in which there needs to be a single instance of a class. The&lt;br /&gt;
most common example of this is a database connection. Implementing this pattern allows a&lt;br /&gt;
programmer to make this single instance easily accessible by many other objects.&lt;br /&gt;
&lt;?php 
classExample 
{ 
// Hold an instance of the class 
private static$instance; 
// A private constructor; prevents direct creation of object 
private function__construct() 
{ 
echo 'I am constructed'; 
}// The singleton method 
public static functionsingleton() 
{ 
if (!isset(self::$instance)) { 
$c= __CLASS__; 
self::$instance = new $c; 
}returnself::$instance;
}// Example method
public functionbark()
{ 
echo'Woof!'; 
}// Prevent users to clone the instance 
public function__clone() 
{ 
trigger_error('Clone is not allowed.', E_USER_ERROR); 
} 
}?&gt; &lt;br /&gt;
&lt;br /&gt;
Magic Methods&lt;br /&gt;
&lt;br /&gt;
The function names __construct, __destruct, __call, __callStatic, __get, __set, __isset, __unset,&lt;br /&gt;
__sleep, __wakeup, __toString, __invoke, __set_state and __clone are magical in PHP classes. You&lt;br /&gt;
cannot have functions with these names in any of your classes unless you want the magic functionality&lt;br /&gt;
associated with them.&lt;br /&gt;
Caution&lt;br /&gt;
PHP reserves all function names starting with __ as magical. It is recommended that you do not use&lt;br /&gt;
function names with __ in PHP unless you want some documented magic functionality.&lt;br /&gt;
__sleepand __wakeup&lt;br /&gt;
&lt;br /&gt;
serialize() checks if your class has a function with the magic name __sleep. If so, that function is&lt;br /&gt;
executed prior to any serialization. It can clean up the object and is supposed to return an array with the&lt;br /&gt;
names of all variables of that object that should be serialized. If the method doesn't return anything then&lt;br /&gt;
NULL is serialized and E_NOTICE is issued.&lt;br /&gt;
The intended use of __sleep is to commit pending data or perform similar cleanup tasks. Also, the&lt;br /&gt;
function is useful if you have very large objects which do not need to be saved completely.&lt;br /&gt;
Conversely, unserialize() checks for the presence of a function with the magic name __wakeup. If&lt;br /&gt;
present, this function can reconstruct any resources that the object may have.&lt;br /&gt;
The intended use of __wakeup is to reestablish any database connections that may have been lost&lt;br /&gt;
during serialization and perform other reinitialization tasks.&lt;br /&gt;
&lt;br /&gt;
__toString&lt;br /&gt;
The__toStr ing method allows a class to decide how it will react when it is converted to a string.&lt;br /&gt;
It is worth noting that before PHP 5.2.0 the __toString method was only called when it was directly&lt;br /&gt;
combined with echo() or print(). Since PHP 5.2.0, it is called in any string context (e.g. inprintf() with&lt;br /&gt;
%s modifier) but not in other types contexts (e.g. with %d modifier). Since PHP 5.2.0, converting&lt;br /&gt;
objects without__toStr ing method to string would causeE_RECOVERABLE_ERROR.&lt;br /&gt;
&lt;br /&gt;
__invoke&lt;br /&gt;
The__invoke method is called when a script tries to call an object as a function.&lt;br /&gt;
__set_state&lt;br /&gt;
Thiss tatic method is called for classes exported byvar_expor t() since PHP 5.1.0.&lt;br /&gt;
The only parameter of this method is an array containing exported properties in the form&lt;br /&gt;
array('property' =&gt; value, ...)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-1368468215963891525?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rNiyQF8fuAc9XB6Z3-NgLn6cEa0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rNiyQF8fuAc9XB6Z3-NgLn6cEa0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rNiyQF8fuAc9XB6Z3-NgLn6cEa0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rNiyQF8fuAc9XB6Z3-NgLn6cEa0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/B-JoMPMk8uA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/1368468215963891525/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=1368468215963891525" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1368468215963891525?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1368468215963891525?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/B-JoMPMk8uA/patterns-in-php.html" title="Patterns in PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/patterns-in-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQn06eCp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-3575476141214640066</id><published>2011-05-12T06:29:00.000-07:00</published><updated>2011-05-13T13:27:13.310-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.310-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Overloading in PHP</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Overloading &lt;br /&gt;
Overloading in PHP provides means to dynamically "create" properties and methods. These dynamic &lt;br /&gt;
entities are processed via magic methods one can establish in a class for various action types. &lt;br /&gt;
The overloading methods are invoked when interacting with properties or methods that have not been declared or are not visible in the current scope. The rest of this section will use the terms "inaccessible properties" and "inaccessible methods" to refer to this combination of declaration and visibility. &lt;br /&gt;
All overloading methods must be defined as public. &lt;br /&gt;
Note: None of the arguments of these magic methods can be passed by reference. &lt;br /&gt;
Note: PHP's interpretation of "overloading" is different than most object oriented&lt;br /&gt;
languages. Overloading traditionally provides the ability to have multiple methods with the&lt;br /&gt;
same name but different quantities and types of arguments.&lt;br /&gt;
Changelog &lt;br /&gt;
Version &lt;br /&gt;
Description &lt;br /&gt;
5.3.0 &lt;br /&gt;
Added__callStati c(). Added warning to enforce public visibility and non-static declaration. &lt;br /&gt;
5.1.0 &lt;br /&gt;
Added__iss et() and__unset(). &lt;br /&gt;
Property overloading &lt;br /&gt;
void__s et ( string$name , mixed$value )&lt;br /&gt;
mixed__get ( string$name )&lt;br /&gt;
bool__iss et ( string$name )&lt;br /&gt;
void__un s et ( string$name ) &lt;br /&gt;
__set() is run when writing data to inaccessible properties.&lt;br /&gt;
__get() is utilized for reading data from inaccessible properties.&lt;br /&gt;
__isset() is triggered by calling isset() or empty() on inaccessible properties.&lt;br /&gt;
__unset() is invoked when unset() is used on inaccessible properties.&lt;br /&gt;
The$nam e argument is the name of the property being interacted with. The__s et() method's$value &lt;br /&gt;
argument specifies the value the$nam e'ed property should be set to. &lt;br /&gt;
Property overloading only works in object context. These magic methods will not be triggered in static &lt;br /&gt;
context. Therefore these methods can not be declared static. &lt;br /&gt;
Note: The return value of __set() is ignored because of the way PHP processes the &lt;br /&gt;
assignment operator. Similarly,__get() is never called when chaining assignemnts together &lt;br /&gt;
like this: &lt;br /&gt;
$a = $obj-&gt;b = 8; &lt;br /&gt;
&lt;?php 
classPropertyTest { 
/** Location for overloaded data. */ 
private$data = array(); 
/** Overloading not used on declared properties. */ 
public$declared =1; 
/** Overloading only used on this when accessed outside the clas 
s. */ 
private$hidden =2; 
public function__set($name,$value) { 
echo "Setting '$name' to '$value'\n"; 
$this-&gt;data[$name]= $value; &lt;br /&gt;
}public function__get($name) { &lt;br /&gt;
echo "Getting '$name'\n"; &lt;br /&gt;
if (array_key_exists($name,$this-&gt;data)) { &lt;br /&gt;
return$this-&gt;data[$name]; &lt;br /&gt;
}$trace= debug_backtrace(); &lt;br /&gt;
trigger_error( &lt;br /&gt;
'Undefined property via __get(): '. $name .&lt;br /&gt;
' in ' .$trace[0]['file'].&lt;br /&gt;
' on line ' .$trace[0]['line'],&lt;br /&gt;
E_USER_NOTICE); &lt;br /&gt;
returnnull; &lt;br /&gt;
}/** As of PHP 5.1.0 */ &lt;br /&gt;
public function__isset($name) {&lt;br /&gt;
echo "Is '$name' set?\n";&lt;br /&gt;
return isset($this-&gt;data[$name]);&lt;br /&gt;
}/** As of PHP 5.1.0 */ &lt;br /&gt;
public function__unset($name) {&lt;br /&gt;
echo "Unsetting '$name'\n";&lt;br /&gt;
unset($this-&gt;data[$name]);&lt;br /&gt;
}/** Not a magic method, just here for example. */ &lt;br /&gt;
public functiongetHidden() { &lt;br /&gt;
return$this-&gt;hidden; &lt;br /&gt;
} &lt;br /&gt;
}echo"&lt; pre&gt;\n"; &lt;br /&gt;
 &lt;br /&gt;
$obj = new PropertyTest; &lt;br /&gt;
$obj-&gt;a= 1; &lt;br /&gt;
echo$obj-&gt;a ."\n\n"; &lt;br /&gt;
var_dump(isset($obj-&gt;a)); &lt;br /&gt;
unset($obj-&gt;a); &lt;br /&gt;
var_dump(isset($obj-&gt;a)); &lt;br /&gt;
echo"\n";&lt;br /&gt;
echo$obj-&gt;declared ."\n\n";&lt;br /&gt;
echo "Let's experiment with the private property named 'hidden':\n";&lt;br /&gt;
echo "Privates are visible inside the class, so __get() not used...\n &lt;br /&gt;
"; &lt;br /&gt;
echo$obj-&gt;getHidden() ."\n";&lt;br /&gt;
echo "Privates not visible outside of class, so __get() is used...\n"&lt;br /&gt;
;echo$obj-&gt;hidden ."\n";&lt;br /&gt;
?&gt; &lt;br /&gt;
Method overloading &lt;br /&gt;
mixed__cal l ( string$name , array$arguments ) &lt;br /&gt;
mixed__cal lStatic ( string$name , array$arguments ) &lt;br /&gt;
__call() is triggered when invoking inaccessible methods in an object context. &lt;br /&gt;
__callStatic() is triggered when invoking inaccessible methods in a static context. &lt;br /&gt;
The$nam e argument is the name of the method being called. The$ a rg um en ts argument is an &lt;br /&gt;
enumerated array containing the parameters passed to the$nam e'ed method. &lt;br /&gt;
&lt;?php 
classMethodTest { 
public function__call($name,$arguments) { 
// Note: value of $name is case sensitive. 
echo "Calling object method '$name' " 
.implode(', ',$arguments)."\n"; 
}/** As of PHP 5.3.0 */ 
public static function__callStatic($name,$arguments) { 
// Note: value of $name is case sensitive. 
echo "Calling static method '$name' " 
.implode(', ',$arguments)."\n"; 
} 
}$obj = new MethodTest; 
$obj-&gt;runTest('in object context'); &lt;br /&gt;
MethodTest::runTest('in static context');// As of PHP 5.3.0 &lt;br /&gt;
?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-3575476141214640066?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QsVuEFsNwDmkMJr0dFl2iNaqGMk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QsVuEFsNwDmkMJr0dFl2iNaqGMk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QsVuEFsNwDmkMJr0dFl2iNaqGMk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QsVuEFsNwDmkMJr0dFl2iNaqGMk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/gWznMeKh9zE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/3575476141214640066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=3575476141214640066" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3575476141214640066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/3575476141214640066?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/gWznMeKh9zE/overloading-in-php.html" title="Overloading in PHP" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/overloading-in-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQno8eSp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-689122180835017846</id><published>2011-05-12T06:27:00.002-07:00</published><updated>2011-05-13T13:27:13.471-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.471-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Object Interfaces</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Object Interfaces &lt;br /&gt;
Object interfaces allow you to create code which specifies which methods a class must implement, &lt;br /&gt;
without having to define how these methods are handled. &lt;br /&gt;
Interfaces are defined using the interface keyword, in the same way as a standard class, but without any &lt;br /&gt;
of the methods having their contents defined. &lt;br /&gt;
All methods declared in an interface must be public, this is the nature of an interface. &lt;br /&gt;
implements &lt;br /&gt;
To implement an interface, theim plem ents operator is used. All methods in the interface must be&lt;br /&gt;
implemented within a class; failure to do so will result in a fatal error. Classes may implement more&lt;br /&gt;
than one interface if desired by separating each interface with a comma.&lt;br /&gt;
Note: A class cannot implement two interfaces that share function names, since it would &lt;br /&gt;
cause ambiguity. &lt;br /&gt;
Note: Interfaces can be extended like classes using theextend operator. &lt;br /&gt;
Note: The class implementing the interface must use the exact same method signatures as &lt;br /&gt;
are defined in the interface. Not doing so will result in a fatal error. &lt;br /&gt;
Constants &lt;br /&gt;
Its possible for interfaces to have constants. Interface constants works exactly like class constants. They &lt;br /&gt;
cannot be overridden by a class/interface that inherits it. &lt;br /&gt;
Examples &lt;br /&gt;
&lt;?php 
interfacea 
{ 
public functionfoo(); 
}interfaceb extendsa 
{ 
public functionbaz(Baz $baz); 
}// This will work 
classc implementsb 
{
public functionfoo()
{}public functionbaz(Baz $baz)
{} 
}// This will not work and result in a fatal error 
classd implementsb 
{
public functionfoo()
{}public functionbaz(Foo $foo)
{} 
}?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-689122180835017846?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yT1K-xb_Kjjxl9ZGB2CyGDTDyYg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yT1K-xb_Kjjxl9ZGB2CyGDTDyYg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yT1K-xb_Kjjxl9ZGB2CyGDTDyYg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yT1K-xb_Kjjxl9ZGB2CyGDTDyYg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/Tb_zI18i3w4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/689122180835017846/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=689122180835017846" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/689122180835017846?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/689122180835017846?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/Tb_zI18i3w4/object-interfaces.html" title="Object Interfaces" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/object-interfaces.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQnw9cCp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-1028229923900565782</id><published>2011-05-12T06:27:00.001-07:00</published><updated>2011-05-13T13:27:13.268-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:13.268-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Static Keyword</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Static Keyword &lt;br /&gt;
Declaring class properties or methods as static makes them accessible without needing an instantiation of the class. A property declared as static can not be accessed with an instantiated class object (though a static method can). &lt;br /&gt;
For compatibility with PHP 4, if no visibility declaration is used, then the property or method will be &lt;br /&gt;
treated as if it was declared as public. &lt;br /&gt;
Because static methods are callable without an instance of the object created, the pseudo-variable $this &lt;br /&gt;
is not available inside the method declared as static.&lt;br /&gt;
Static properties cannot be accessed through the object using the arrow operator -&gt;.&lt;br /&gt;
Calling non-static methods statically generates an E_STRICT level warning.&lt;br /&gt;
Like any other PHP static variable, static properties may only be initialized using a literal or constant;&lt;br /&gt;
expressions are not allowed. So while you may initialize a static property to an integer or array (for &lt;br /&gt;
instance), you may not initialize it to another variable, to a function return value, or to an object. &lt;br /&gt;
As of PHP 5.3.0, it's possible to reference the class using a variable. The variable's value can not be a &lt;br /&gt;
keyword (e.g. self, parent and static). &lt;br /&gt;
&lt;?php 
classFoo 
{ 
public static$my_static ='foo'; 
public functionstaticValue() { 
returnself::$my_static; 
} 
}classBar extendsFoo 
{ 
public functionfooStatic() { 
returnparent::$my_static; 
} 
}printFoo::$my_static ."\n"; 
$foo = new Foo(); 
print$foo-&gt;staticValue() ."\n"; &lt;br /&gt;
print$foo-&gt;my_static ."\n"; &lt;br /&gt;
// Undefined "Property" my_static &lt;br /&gt;
print$foo::$my_static ."\n"; &lt;br /&gt;
$classname ='Foo'; &lt;br /&gt;
print$classname::$my_static ."\n"; // As of PHP 5.3.0 &lt;br /&gt;
printBar::$my_static ."\n"; &lt;br /&gt;
$bar = new Bar(); &lt;br /&gt;
print$bar-&gt;fooStatic() ."\n"; &lt;br /&gt;
?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-1028229923900565782?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iak3EeWTticdLm8m6Sf2roSFodw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iak3EeWTticdLm8m6Sf2roSFodw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iak3EeWTticdLm8m6Sf2roSFodw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iak3EeWTticdLm8m6Sf2roSFodw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/pOgWUMs-upc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/1028229923900565782/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=1028229923900565782" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1028229923900565782?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1028229923900565782?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/pOgWUMs-upc/static-keyword.html" title="Static Keyword" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/static-keyword.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHQ3Y-fSp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-7050443091316559266.post-1303017555758038821</id><published>2011-05-12T06:27:00.000-07:00</published><updated>2011-05-13T13:27:12.855-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:27:12.855-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in PHP" /><title>Class Abstraction</title><content type="html">more info.. http://evergreenphp.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Class Abstraction &lt;br /&gt;
PHP 5 introduces abstract classes and methods. It is not allowed to create an instance of a class that has&lt;br /&gt;
been defined as abstract. Any class that contains at least one abstract method must also be abstract.&lt;br /&gt;
Methods defined as abstract simply declare the method's signature they cannot define the&lt;br /&gt;
implementation.&lt;br /&gt;
When inheriting from an abstract class, all methods marked abstract in the parent's class declaration&lt;br /&gt;
must be defined by the child; additionally, these methods must be defined with the same (or a less&lt;br /&gt;
restricted)vis ibil ity. For example, if the abstract method is defined as protected, the function&lt;br /&gt;
implementation must be defined as either protected or public, but not private.&lt;br /&gt;
&lt;?php 
abstract classAbstractClass 
{ 
// Force Extending class to define this method 
abstract protected functiongetValue(); 
abstract protected functionprefixValue($prefix); 
// Common method 
public functionprintOut() { 
print$this-&gt;getValue() ."\n"; &lt;br /&gt;
} &lt;br /&gt;
}classConcreteClass1 extendsAbstractClass &lt;br /&gt;
{ &lt;br /&gt;
protected functiongetValue() { &lt;br /&gt;
return"ConcreteClass1"; &lt;br /&gt;
}public functionprefixValue($prefix) { &lt;br /&gt;
return"{$prefix}ConcreteClass1"; &lt;br /&gt;
} &lt;br /&gt;
}classConcreteClass2 extendsAbstractClass &lt;br /&gt;
{ &lt;br /&gt;
public functiongetValue() { &lt;br /&gt;
return"ConcreteClass2"; &lt;br /&gt;
}public functionprefixValue($prefix) { &lt;br /&gt;
return"{$prefix}ConcreteClass2"; &lt;br /&gt;
} &lt;br /&gt;
}$class1 = new ConcreteClass1; &lt;br /&gt;
$class1-&gt;printOut(); &lt;br /&gt;
echo$class1-&gt;prefixValue('FOO_') ."\n"; &lt;br /&gt;
$class2 = new ConcreteClass2; &lt;br /&gt;
$class2-&gt;printOut(); &lt;br /&gt;
echo$class2-&gt;prefixValue('FOO_') ."\n"; &lt;br /&gt;
?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7050443091316559266-1303017555758038821?l=allthephp.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RVe_m3Ihfk1sK6Ahk3BpI3d8x2o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RVe_m3Ihfk1sK6Ahk3BpI3d8x2o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RVe_m3Ihfk1sK6Ahk3BpI3d8x2o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RVe_m3Ihfk1sK6Ahk3BpI3d8x2o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KEpx/~4/NXGKkUjyDv0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://allthephp.blogspot.com/feeds/1303017555758038821/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7050443091316559266&amp;postID=1303017555758038821" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1303017555758038821?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7050443091316559266/posts/default/1303017555758038821?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KEpx/~3/NXGKkUjyDv0/class-abstraction.html" title="Class Abstraction" /><author><name>phpexpert</name><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><thr:total>0</thr:total><feedburner:origLink>http://allthephp.blogspot.com/2011/05/class-abstraction.html</feedburner:origLink></entry></feed>

