<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>How To Do Everything &#124; How To Tutorials &#187; PHP</title>
	<atom:link href="http://howtoideas.net/category/computer-and-programming/programming-languages/php/feed" rel="self" type="application/rss+xml" />
	<link>http://howtoideas.net</link>
	<description>How To Ideas</description>
	<lastBuildDate>Wed, 25 Apr 2012 21:22:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Embed PHP using Different Tag Types</title>
		<link>http://howtoideas.net/how-to-embed-php-using-different-tag-types</link>
		<comments>http://howtoideas.net/how-to-embed-php-using-different-tag-types#comments</comments>
		<pubDate>Sun, 17 Jul 2011 07:19:54 +0000</pubDate>
		<dc:creator>Sarbjit Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Different PHP tags]]></category>
		<category><![CDATA[different types of php tags]]></category>

		<guid isPermaLink="false">http://howtoideas.net/how-to-embed-php-using-different-tag-types</guid>
		<description><![CDATA[In PHP language, there are some different types of tags to start and end the PHP script. There are four delimitation variants, all of which are introduced below: Default Syntax: The default delimiter syntax opens with “&#60;?php” and ends with “?&#62;” &#60;?php &#160;&#160;&#160; echo &#34;Text using the default syntax of tags.&#34;; ?&#62; Short-Tags: These tags are known as short-tags because you are typing less for same result. The difference is... <span class="meta-more"><a href="http://howtoideas.net/how-to-embed-php-using-different-tag-types">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>In PHP language, there are some different types of tags to start and end the PHP script. There are four delimitation variants, all of which are introduced below:</p>
<ol>
<li><strong>Default Syntax:</strong> The default delimiter syntax opens with “&lt;?php” and ends with “?&gt;”       <br /><code><br />
<blockquote>
<p>&lt;?php            <br />&#160;&#160;&#160; echo &quot;Text using the default syntax of tags.&quot;;             <br />?&gt;</p>
</blockquote>
<p>     </code></li>
<li><strong>Short-Tags:</strong> These tags are known as short-tags because you are typing less for same result. The difference is you should enable the “short_open_tag” property of your PHP settings on your server. Although short-tags are convenient to use but they clash with the XML and XHTML syntax. Therefore, avoid short-tags in your programming for batter result.<code><br />
<blockquote>
<p>&lt;?&#160; <br />&#160;&#160;&#160; echo &quot;Text using the short-tags.&quot;;             <br />?&gt;</p>
</blockquote>
<p>     </code></li>
<li><strong>Script:</strong> You can use script tags to insert PHP code. To use this type use Script tags in your page. <code><br />
<blockquote>
<p>&lt;script language=&quot;php&quot;&gt;            <br />&#160;&#160;&#160; echo &quot;Text using Script tags.&quot;;             <br />&lt;/script&gt;</p>
</blockquote>
<p>     </code></li>
<li><strong>ASP Style:</strong> If you’re from an ASP background then prefer to continue using this escape syntax, PHP supports it. But this syntax is removed in PHP 6. <code><br />
<blockquote>
<p>&lt;%            <br />&#160;&#160;&#160; echo &quot;Text using ASP type tags.&quot;;             <br />%&gt;</p>
</blockquote>
<p>     </code></li>
</ol>
<p>Enjoy…</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-embed-php-using-different-tag-types/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Write Your First PHP Code</title>
		<link>http://howtoideas.net/how-to-write-your-first-php-code</link>
		<comments>http://howtoideas.net/how-to-write-your-first-php-code#comments</comments>
		<pubDate>Sat, 16 Jul 2011 13:47:32 +0000</pubDate>
		<dc:creator>Sarbjit Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[First PHP code]]></category>
		<category><![CDATA[PHP first program]]></category>
		<category><![CDATA[PHP first script]]></category>

		<guid isPermaLink="false">http://howtoideas.net/how-to-write-your-first-php-code</guid>
		<description><![CDATA[Under the label PHP you can learn basics, intermediate and advanced programming in PHP. If you are the beginner lets start with your first script in PHP. &#60;html&#62; &#60;head&#62; &#160;&#160;&#160; &#60;title&#62;First PHP Script&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#160;&#160;&#160; &#60;?php &#160;&#160;&#160;&#160;&#160;&#160;&#160; echo &#34;This is the text using PHP.&#34;; &#160;&#160;&#160; ?&#62; &#60;/body&#62; &#60;/html&#62; In the above example there is a basic structure of HTML. In the body tag I used PHP code. To start... <span class="meta-more"><a href="http://howtoideas.net/how-to-write-your-first-php-code">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Under the label PHP you can learn basics, intermediate and advanced programming in PHP. If you are the beginner lets start with your first script in PHP.</p>
<p> <code><br />
<blockquote>
<p>&lt;html&gt;       <br />&lt;head&gt;        <br />&#160;&#160;&#160; &lt;title&gt;First PHP Script&lt;/title&gt;        <br />&lt;/head&gt;        <br />&lt;body&gt;        <br />&#160;&#160;&#160; &lt;?php         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo &quot;This is the text using PHP.&quot;;        <br />&#160;&#160;&#160; ?&gt;        <br />&lt;/body&gt;        <br />&lt;/html&gt;        </p>
</blockquote>
<p> </code>
<p>In the above example there is a basic structure of HTML. In the body tag I used PHP code. To start the PHP code there is tag which specifies the starting and ending of PHP code. “&lt;?php” denotes the starting of PHP tag and “?&gt;” denotes the ending tag. In between there is a function “echo” it prints the value passed in it. “echo” is not actually a function we can pass value in double quotes also like I did in this example. It can also be called as:</p>
<p> <code><br />
<blockquote>
<p>&lt;?php       <br />&#160;&#160;&#160; echo (&quot;This is the text using PHP.&quot;);        <br />?&gt;        </p>
</blockquote>
<p> </code>
<p>Both examples results the same thing. If you want to pass multiple parameters in the “echo” function.Then use the following code:</p>
<p> <code><br />
<blockquote>
<p>&lt;?php       <br />&#160;&#160;&#160; echo &quot;PHP &quot;, &quot;is &quot;, &quot;a &quot;, &quot;great &quot;, &quot;language.&quot;;        <br />?&gt;</p>
</blockquote>
<p> </code>
<p>Enjoy…</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-write-your-first-php-code/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to validate date in PHP</title>
		<link>http://howtoideas.net/how-to-validate-date-in-php</link>
		<comments>http://howtoideas.net/how-to-validate-date-in-php#comments</comments>
		<pubDate>Wed, 13 Jul 2011 11:16:57 +0000</pubDate>
		<dc:creator>Sarbjit Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[checkdate()]]></category>
		<category><![CDATA[How to validate date and time]]></category>
		<category><![CDATA[validate date and time]]></category>

		<guid isPermaLink="false">http://howtoideas.net/how-to-validate-date-and-time-in-php</guid>
		<description><![CDATA[Sometimes in the forms you want to validate the date via PHP functions to check whether date was in correct format or not. If you didn&#8217;t validate it, it may cause some issues in your code. To prevent such errors you should check the date format in PHP. To perform that use the checkdate() function in PHP. This function accomplishes the task of validating dates quite nicely. returns TRUE if... <span class="meta-more"><a href="http://howtoideas.net/how-to-validate-date-in-php">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Sometimes in the forms you want to validate the date via PHP functions to check whether date was in correct format or not. If you didn&#8217;t validate it, it may cause some issues in your code. To prevent such errors you should check the date format in PHP. To perform that use the checkdate() function in PHP. This function accomplishes the task of validating dates quite nicely. returns TRUE if supplied date is valid otherwise returns FALSE. Its prototype is:</p>
<p>&nbsp;</p>
<blockquote><p>Boolean checkdate ( int month, int day, int year)</p></blockquote>
<p>&nbsp;</p>
<p>For example:</p>
<p>&nbsp;</p>
<blockquote><p>//checkdate() will return TRUE because 2012 is a leap year thus date is valid.<br />
echo &#8220;February 29,2012: is &#8221; . (checkdate(02,29,2012)?&#8217;valid&#8217;:'invalid&#8217;) . &#8221; date&#8221;;</p>
<p>//checkdate() will return FALSE because 2011 is not a leap year thus date is invalid.<br />
echo &#8220;February 29,2011: is &#8221; . (checkdate(02,29,2011)?&#8217;valid&#8217;:'invalid&#8217;) . &#8221; date&#8221;;</p></blockquote>
<p>&nbsp;</p>
<p>Enjoy&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-validate-date-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Declare Dynamic Function/Constructor in php</title>
		<link>http://howtoideas.net/how-to-declare-dynamic-functionconstructor-in-php</link>
		<comments>http://howtoideas.net/how-to-declare-dynamic-functionconstructor-in-php#comments</comments>
		<pubDate>Sat, 02 Jul 2011 12:22:57 +0000</pubDate>
		<dc:creator>Sarbjit Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database connection]]></category>
		<category><![CDATA[Host Username Password]]></category>
		<category><![CDATA[Host Username Password Database Name]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://howtoideas.net/how-to-declare-dynamic-functionconstructor-in-php</guid>
		<description><![CDATA[In many cases you wanted to declare dynamic function which allows you to pass multiple parameters. Here is the example to demonstrate the dynamic function or constructor. Take an example of database connection class in which you want to pass 3 or 4 parameters to constructor. &#60;?php class db_connection{ //To store the databse name private $_database = &#34;&#34;; //To store the connection values private $_mysqli_link; //Declaration of dynamic constructor public... <span class="meta-more"><a href="http://howtoideas.net/how-to-declare-dynamic-functionconstructor-in-php">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>In many cases you wanted to declare dynamic function which allows you to pass multiple parameters. Here is the example to demonstrate the dynamic function or constructor. Take an example of database connection class in which you want to pass 3 or 4 parameters to constructor.</p>
<blockquote><p><code>
<p>&lt;?php        <br />class db_connection{</p>
<p>//To store the databse name        <br />private $_database = &quot;&quot;;</p>
<p>//To store the connection values        <br />private $_mysqli_link;</p>
<p>//Declaration of dynamic constructor        <br />public function __construct(){         <br />//If number of arguments are 3         <br />// Host + Username + Password         <br />if(func_num_args() == 3) {         <br />$this-&gt;_mysqli_link = mysqli_connect(func_get_arg(0),func_get_arg(1),func_get_arg(2)) or die(&quot;Database connection failed.&lt;br/&gt;&quot;);         <br />} </p>
<p>//If number of arguments are 4        <br />// Host + Username + Password + Database Name         <br />elseif(func_num_args() == 4) {         <br />$this-&gt;_database = func_get_arg(3);         <br />$this-&gt;_mysqli_link = mysqli_connect(func_get_arg(0),func_get_arg(1),func_get_arg(2),func_get_arg(3)) or die(&quot;Database connection failed.&lt;br/&gt;&quot;);         <br />}</p>
<p>// If any other syntax is used to instantiate the class        <br />else {         <br />die(&quot;Connection declaration syntax is invalid&quot;);         <br />}         <br />}</p>
<p>// Function to select or change the database name        <br />public function db_select($database){         <br />mysqli_select_db( $this-&gt;_mysqli_link,$database ) or die(&quot;Database selection failed.&quot;);         <br />$this-&gt;_database = $database;         <br />}         <br />}         <br />?&gt;</p>
<p>   </code></p></blockquote>
<p>You can download the source code of this example <a href="http://howtoideas.net/wp-content/uploads/PHP%20Source%20Codes/db_connection.zip">here</a>.</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-declare-dynamic-functionconstructor-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Connect a Database in MySQL Using PHP</title>
		<link>http://howtoideas.net/how-to-connect-a-database-in-mysql-using-php</link>
		<comments>http://howtoideas.net/how-to-connect-a-database-in-mysql-using-php#comments</comments>
		<pubDate>Thu, 02 Jun 2011 20:43:19 +0000</pubDate>
		<dc:creator>Sarbjit Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Connect database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database connection]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://howtoideas.net/how-to-connect-a-database-in-mysql-using-php</guid>
		<description><![CDATA[This code will allow you to connect a Database in MySQL in PHP programming language. There are basically two ways you want to access your database. One is to your local server other one is online server. &#160; Method 1: Via local server This method allows you to connect to your local server &#160; &#60;?php //Change your information according to your server $username = &#34;your_username&#34;; $password = &#34;your_password&#34;; $database =... <span class="meta-more"><a href="http://howtoideas.net/how-to-connect-a-database-in-mysql-using-php">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>This code will allow you to connect a Database in MySQL in PHP programming language. There are basically two ways you want to access your database. One is to your local server other one is online server.</p>
<p>&#160;</p>
<p><strong>Method 1: Via local server</strong></p>
<p>This method allows you to connect to your local server </p>
<p>&#160;</p>
<blockquote><p><code>&lt;?php        <br />//Change your information according to your server         <br /></code><code>$username = &quot;your_username&quot;;        <br />$password = &quot;your_password&quot;;         <br />$database = &quot;your_database_name&quot;;         </p>
<p>//Creating the connection         <br />$connection = mysqli_connect(&quot;localhost&quot;,$username,$password) or die(&quot;Connection not successful.&quot;);         <br />//Selecting the database you want to use in your page         <br />mysqli_select_db($connection, $database) or die(&quot;Database selection failed.&quot;);         </p>
<p>//Your content regarding MySQL lies here         </p>
<p>//Closing your connection         <br />mysqli_close($connection);         <br />?&gt; </code></p>
</blockquote>
<p>&#160;</p>
<p><strong>Method 2: Via online server</strong></p>
<p>If your server is online use this method but change the “example.com” according to your server.</p>
<blockquote><p><code>&lt;?php        <br />//Change your information according to your server         <br /></code>
<p>$username = &quot;your_username&quot;;        <br />$password = &quot;your_password&quot;;         <br />$database = &quot;your_database_name&quot;;         </p>
<p>//Creating the connection         <br />$connection = mysqli_connect(&quot;example.com&quot;,$username,$password) or die(&quot;Connection not successful.&quot;);         <br />//Selecting the database you want to use in your page         <br />mysqli_select_db($connection, $database) or die(&quot;Database selection failed.&quot;);         </p>
<p>//Your content regarding MySQL lies here         </p>
<p>//Closing your connection         <br />mysqli_close($connection);         <br />?&gt; </p>
</p>
</blockquote>
<p>Enjoy…</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-connect-a-database-in-mysql-using-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
