<?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>Web Design company - Goweb99 blog &#187; PHP Tuts</title>
	<atom:link href="http://www.goweb99.com/blog/tag/php-tuts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.goweb99.com/blog</link>
	<description>Get your website designed for as low as $99.</description>
	<lastBuildDate>Fri, 30 Jul 2010 20:27:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP $_GET Function</title>
		<link>http://www.goweb99.com/blog/php-tutorial/php-_get-function/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/php-_get-function/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 07:34:53 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[$_get]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php get]]></category>
		<category><![CDATA[php get function]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=484</guid>
		<description><![CDATA[$_GET is a built-in function in PHP which is used to collect values in a form where the method is &#8220;get&#8221;.
Get method is rarely used though, as the information sent from a form with the GET method is visible to everyone in the browser&#8217;s address bar.
Also it has a limit on the amount of information [...]]]></description>
			<content:encoded><![CDATA[<p>$_GET is a built-in function in PHP which is used to collect values in a form where the method is &#8220;get&#8221;.</p>
<p>Get method is rarely used though, as the information sent from a form with the GET method is visible to everyone in the browser&#8217;s address bar.</p>
<p>Also it has a limit on the amount of information that can be sent. All the information is concatenated in a single line and this line is printed on the browser’s address bar.</p>
<ul>
<div class="example">For eg:</p>
<p>&lt;form action=”data.php” method=”post”&gt;<br />
Name: &lt;input type=”text” name=”username” /&gt;<br />
Address: &lt;input type=”text” name=”address” /&gt;<br />
&lt;input type=”submit” /&gt;<br />
&lt;/form&gt;</p></div>
</ul>
<p>When the user clicks the &#8220;Submit&#8221; button, the URL sent to the server could look something like this:</p>
<ul> http://www.goweb99.com/data.php?username=Tutor&amp;address=Capital+Federal</ul>
<p>The &#8220;data.php&#8221; file can now use the $_GET function to collect form data (the names of the form fields will automatically be the keys in the $_GET array):</p>
<ul>
<div class="example">For eg:</p>
<p>&lt;html&gt;<br />
&lt;body&gt;<br />
Welcome &lt;?php echo $_GET["username"]; ?&gt; ! to the world of PHP&lt;br /&gt;<br />
You live at &lt;?php echo $_GET["address"]; ?&gt; .<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
</ul>
<p>Get method should not be used when sending passwords or other sensitive information.</p>
<p>However, because the variables are displayed in the URL, it is possible to bookmark the page, which may serve some purpose.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/php-_get-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP If Condition</title>
		<link>http://www.goweb99.com/blog/php-tutorial/php-if-condition/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/php-if-condition/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 10:47:58 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php elseif]]></category>
		<category><![CDATA[php if-else]]></category>
		<category><![CDATA[php switch]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=450</guid>
		<description><![CDATA[The If Statement
This statement executes a piece of code only when a condition is true.
Syntax
 if (condition) code to be executed if condition is true;

For eg:
&#60;html&#62;
&#60;body&#62;
&#60;?php
$d=date(&#8221;D&#8221;);
if ($d==&#8221;Fri&#8221;) echo &#8220;Today is Friday!&#8221;;
?&#62;
&#60;/body&#62;
&#60;/html&#62;

The if&#8230;else Statement
This is a two way condition evaluation, in which there are yes and no both lead to different code block.
We just add one [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The If Statement</strong></p>
<p>This statement executes a piece of code only when a condition is true.</p>
<p>Syntax</p>
<ul> if (condition) code to be executed if condition is true;</ul>
<ul>
<div class="example">For eg:</p>
<p>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
$d=date(&#8221;D&#8221;);<br />
if ($d==&#8221;Fri&#8221;) echo &#8220;Today is Friday!&#8221;;<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
</ul>
<p><strong>The if&#8230;else Statement</strong></p>
<p>This is a two way condition evaluation, in which there are yes and no both lead to different code block.</p>
<p>We just add one else condition in the above if statement.</p>
<p>Syntax</p>
<ul> if (condition)<br />
code to be executed if condition is true;<br />
else<br />
code to be executed if condition is false;</ul>
<ul>
<div class="example">For eg:</p>
<p>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
$d=date(&#8221;D&#8221;);          if ($d==&#8221;Fri&#8221;)<br />
echo &#8220;Today is Friday!&#8221;;         else<br />
echo &#8220;Today is not Friday!&#8221;;<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
</ul>
<p>If more than one line should be executed, then the lines should be enclosed within curly braces:</p>
<ul>
<div class="example">&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
$d=date(&#8221;D&#8221;);<br />
if ($d==&#8221;Fri&#8221;)<br />
{<br />
echo &#8220;Hello!&lt;br /&gt;&#8221;;<br />
echo &#8220;Today is Friday!&#8221;;<br />
}<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
</ul>
<p><strong>The if&#8230;elseif&#8230;.else Statement</strong></p>
<p>This construct is used when there are more conditions than just true or false.</p>
<p>When PHP evaluates If&#8230;elseif&#8230;else statement it first sees if the If statement is true. If that test comes out to be false it then checks the first elseif statement.</p>
<p>If then also the result comes out to be false it will check the next elseif statement, if there exists any more otherwise, it will evaluate the else segment, if one exists.</p>
<p>Syntax</p>
<ul> if (condition)<br />
code to be executed if condition is true;<br />
elseif (condition)<br />
code to be executed if condition is true;<br />
else<br />
code to be executed if condition is false;</ul>
<ul>
<div class="example">
For eg:</p>
<p>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
$d=date(&#8221;D&#8221;);        if ($d==&#8221;Fri&#8221;)<br />
echo &#8220;Today is Friday!&#8221;;        elseif ($d==&#8221;Sun&#8221;)<br />
echo &#8220;Today is Sunday!&#8221;;        else<br />
echo &#8220;Today is neither Friday nor Sunday!&#8221;;<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/php-if-condition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conditional Statements</title>
		<link>http://www.goweb99.com/blog/php-tutorial/conditional-statements/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/conditional-statements/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 10:08:36 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[if statement]]></category>
		<category><![CDATA[if...else]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php if-else]]></category>
		<category><![CDATA[php switch]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP Tuts]]></category>
		<category><![CDATA[switch case]]></category>
		<category><![CDATA[switch statement]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=440</guid>
		<description><![CDATA[Conditional statements are used to evaluate some conditions and perform different actions based on the outcome.
You can use conditional statements in your code to do this.
PHP provides the following conditional statements:

If statement &#8211; execute the piece of code only if a specified condition is true.
if (condition) code to be executed if condition is true;


If&#8230;else statement [...]]]></description>
			<content:encoded><![CDATA[<p>Conditional statements are used to evaluate some conditions and perform different actions based on the outcome.</p>
<p>You can use conditional statements in your code to do this.</p>
<p>PHP provides the following conditional statements:</p>
<ul>
<li>If statement &#8211; execute the piece of code only if a specified condition is true.
<p><span style="color: #808080;">if (condition) code to be executed if condition is true;</span></li>
</ul>
<ul>
<li>If&#8230;else statement – this statement executes a two way condition, where the true part does something else and the false part executes something else.
<p><span style="color: #808080;">if (condition)<br />
code to be executed if condition is true;<br />
else<br />
code to be executed if condition is false;</span></li>
</ul>
<ul>
<li>If&#8230;elseif&#8230;.else statement – if there are multi-way condition, where there are several blocks of code to be executed based on different conditions.
<p><span style="color: #808080;">if (condition)<br />
code to be executed if condition is true;<br />
elseif (condition)<br />
code to be executed if condition is true;<br />
else<br />
code to be executed if condition is false;</span></li>
</ul>
<ul>
<li>Switch statement &#8211; this statement is used to select one of many blocks of code to be executed
<p><span style="color: #808080;">switch (n)<br />
{<br />
case label1:<br />
code to be executed if n=label1;<br />
break;<br />
case label2:<br />
code to be executed if n=label2;<br />
break;<br />
default:<br />
code to be executed if n is different from both label1 and label2;<br />
}</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/conditional-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combining Arithmetic &amp; Assignment Operators</title>
		<link>http://www.goweb99.com/blog/php-tutorial/combining-arithmetic-assignment-operators/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/combining-arithmetic-assignment-operators/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 09:45:21 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php operators]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=434</guid>
		<description><![CDATA[We often need to increment a variable by a fixed amount. For eg a variable which is being used to count something, may be a counter for a loop or some other purpose, we need to constantly increment it by 1.
 $count = $count + 1;
However, there is another way for doing this.
 $counter += [...]]]></description>
			<content:encoded><![CDATA[<p>We often need to increment a variable by a fixed amount. For eg a variable which is being used to count something, may be a counter for a loop or some other purpose, we need to constantly increment it by 1.</p>
<ul> $count = $count + 1;</ul>
<p>However, there is another way for doing this.</p>
<ul> $counter += 1;</ul>
<p>This combined assignment/arithmetic operator would accomplish the same task as the above code.</p>
<p>Although this combined operator shortens the code but sometimes for those who are not accustomed to such programming constructs, this may create confusion and may make the code unreadable.0</p>
<ul>
<table border="0" width="100%">
<tbody>
<tr>
<td>Operator</td>
<td>Description</td>
<td>Example</td>
<td>Expanded Form</td>
</tr>
<tr>
<td>+=</td>
<td>Plus Equals</td>
<td>$x += 2;</td>
<td>$x = $x + 2;</td>
</tr>
<tr>
<td>-=</td>
<td>Minus Equals</td>
<td>$x -= 4;</td>
<td>$x = $x &#8211; 4;</td>
</tr>
<tr>
<td>*=</td>
<td>Multiply Equals</td>
<td>$x *= 3;</td>
<td>$x = $x * 3;</td>
</tr>
<tr>
<td>/=</td>
<td>Divide Equals</td>
<td>$x /= 2;</td>
<td>$x = $x / 2;</td>
</tr>
<tr>
<td>%=</td>
<td>Modulo Equals</td>
<td>$x %= 5;</td>
<td>$x = $x % 5;</td>
</tr>
<tr>
<td>.=</td>
<td>Concatenate Equals</td>
<td>$my_str.=&#8221;PHP&#8221;;</td>
<td>$my_str = $my_str .&#8221;PHP&#8221;;</td>
</tr>
</tbody>
</table>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/combining-arithmetic-assignment-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Operators</title>
		<link>http://www.goweb99.com/blog/php-tutorial/php-operators/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/php-operators/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 08:04:15 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php arithmetic]]></category>
		<category><![CDATA[php assignment]]></category>
		<category><![CDATA[php comparison]]></category>
		<category><![CDATA[php operators]]></category>
		<category><![CDATA[php string operator]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=412</guid>
		<description><![CDATA[Operators are used to manipulate the values or directly or to operate on variables to manipulate values.
All the operators are categorized under the following:

Assignment Operators
Arithmetic Operators
Comparison Operators
String Operators

This section lists the different operators available in PHP.
Assignment Operators
Assignment operators assign a value to a variable, or the value of a variable to another variable.
$my_var = 4;
$another_var [...]]]></description>
			<content:encoded><![CDATA[<p>Operators are used to manipulate the values or directly or to operate on variables to manipulate values.</p>
<p>All the operators are categorized under the following:</p>
<ul>
<li>Assignment Operators</li>
<li>Arithmetic Operators</li>
<li>Comparison Operators</li>
<li>String Operators</li>
</ul>
<p>This section lists the different operators available in PHP.</p>
<p><strong>Assignment Operators</strong></p>
<p>Assignment operators assign a value to a variable, or the value of a variable to another variable.</p>
<div class="example">$my_var = 4;<br />
$another_var = $my_var;</div>
<p>Now both $my_var and $another_var contain the value 4.</p>
<p>Assignments can also be used in conjunction with arithmetic operators, which we will be studying later in this tutorial.</p>
<p><strong>Arithmetic Operators</strong></p>
<ul>
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td><strong>Operator</strong></td>
<td><strong>Description</strong></td>
<td><strong>Example</strong></td>
</tr>
<tr>
<td>+</td>
<td>Addition</td>
<td>2 + 4</td>
</tr>
<tr>
<td>-</td>
<td>Subtraction</td>
<td>6-2</td>
</tr>
<tr>
<td>*</td>
<td>Multiplication</td>
<td>5*3</td>
</tr>
<tr>
<td>/</td>
<td>Division</td>
<td>15/3</td>
</tr>
<tr>
<td>%</td>
<td>Modulus</td>
<td>43%10</td>
</tr>
</tbody>
</table>
</ul>
<div class="example">$addition= 2+3;<br />
$subtraction= 3-2;<br />
$multiplication= 2*3;<br />
$division= 22/11;<br />
$modulus = 5 % 2;</div>
<p><strong>Comparison Operators</strong></p>
<p>Comparison Operators are used to compare the values of two operators. These operators are used inside conditional statements and evaluate to either true or false. PHP provides all the comparison operators that are provided by other programming language.<br />
Assume: $x = 4 and $y = 5;</p>
<ul>
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td><strong>Operator</strong></td>
<td><strong>Description</strong></td>
<td><strong>Example</strong></td>
<td><strong>Result</strong></td>
</tr>
<tr>
<td>==</td>
<td>Equal To</td>
<td>$x == $y</td>
<td>false</td>
</tr>
<tr>
<td>!=</td>
<td>Not Equal To</td>
<td>$x != $y</td>
<td>true</td>
</tr>
<tr>
<td>&lt;</td>
<td>Less Than</td>
<td>$x &lt; $y</td>
<td>true</td>
</tr>
<tr>
<td>&gt;</td>
<td>Greater Than</td>
<td>$x &gt; $y</td>
<td>false</td>
</tr>
<tr>
<td>&lt;=</td>
<td>Less Than or Equal To</td>
<td>$x &lt;= $y</td>
<td>true</td>
</tr>
<tr>
<td>&gt;=</td>
<td>Greater Than or Equal To</td>
<td>$x &gt;= $y</td>
<td>false</td>
</tr>
</tbody>
</table>
</ul>
<p><strong>String Operators</strong></p>
<p>As we have learned before the dot operator is used to concatenate or join two strings.</p>
<div class="example">$a_string=”Hello”;<br />
$b_string=”  Tutor”;<br />
$new_string=$a_string . $_string;<br />
Echo $new_string;</div>
<div class="example">Output</p>
<p>Hello Tutor</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/php-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arrays</title>
		<link>http://www.goweb99.com/blog/php-tutorial/arrays/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/arrays/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 12:28:42 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[associative array]]></category>
		<category><![CDATA[php array]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=386</guid>
		<description><![CDATA[An array is a collection of similar type of values. It is a data structure which stores one or more similar type values as a single value. In PHP arrays are actually maps, ie each key is mapped to a value.
We are assuming that you have a basic knowledge of programming, so you must be [...]]]></description>
			<content:encoded><![CDATA[<p>An array is a collection of similar type of values. It is a data structure which stores one or more similar type values as a single value. In PHP arrays are actually maps, ie each key is mapped to a value.</p>
<p>We are assuming that you have a basic knowledge of programming, so you must be knowing what are arrays.</p>
<p>If you are new to programming, then it may confuse you, as till now one variable can store only one value but this variable can store multiple values.</p>
<p>You may think an array as a container with many spaces where you can fill data according to your choice. Arrays group similar kind of data as it doesn’t make sense to store a set of like values in different variables.</p>
<p>For eg if you want to store your marks of different subject, if you have only 5 subjects then you can store them separately, but if you are having twenty or thirty subjects or even more then it will look very clumsy to use so much variables moreover it will be very tough to manage such number of variables.</p>
<p>You can define array using square brackets as:</p>
<div class="example">$my_array[];</p>
</div>
<p>You can assign values to the array elements as:</p>
<div class="example">$marks[0]=20;<br />
$ marks [1]=10;</p>
</div>
<p>Araay can be understood using the key / value structure. Keys are the numbers specified in the array and the values are the marks. Each key of an array is associated with a value that we can manipulate and reference.</p>
<p>The general form to set the key of an array equal to a value is:</p>
<div class="example">$array[key] = value;</div>
<p>In other programming language you can only provide integer as the key value for the array but in PHP you can also specify a string as the key. This later type is referred to as Associative array</p>
<p>PHP arrays are mostly used with loops, which we will be discussing soon.</p>
<p>In PHP you have the following types of arrays:</p>
<ul>
<li>Numeric array &#8211; An array with a numeric index</li>
<li>Associative array &#8211; An array where each ID key is associated with a value</li>
<li>Multidimensional array &#8211; An array containing one or more arrays</li>
</ul>
<p><strong>Numeric Arrays</strong></p>
<p>A numeric array is the most common type of array, which stores each array element with a numeric index. This kind of array is found in all programming languages.</p>
<p>There are two methods to create a numeric array.</p>
<ol>
<li>In the following example the index are automatically assigned (the index starts at 0)&lt;$marks=array(20,10,30,40)</li>
<li>In the following example we assign the index manually:$marks[0]=20;<br />
$ marks [1]=10;<br />
$ marks[2]=30;<br />
$ marks [3]=40;</li>
</ol>
<p><strong>Associative Arrays</strong></p>
<p>In an associative array the key used is a string value. We have already seen how you can store the marks of the subjects you studied till now using an array. But there was a slight problem, you will not be able to distinguish which mark is for which subject unless you write it somewhere that which key value stands for which subject. This is extra information you will have to manage somewhere outside your program. Rather if there have been a way to store them together then it will lessen your burden.</p>
<p>Associative array is such a way. The key values of this array are strings.</p>
<p>$marks[“Physics”]=20;<br />
$marks[“Chemistry”]=30;<br />
$marks[“Biology”]=40;<br />
$marks[“Maths”]=60;</p>
<p><strong>Multidimensional Arrays</strong></p>
<p>A multidimensional array is an array of arrays. In a multidimensional array, each element in the main array is also be an array. And each element in the sub-array can be an array, and so on.</p>
<p>$families = array  (&#8221;Fruit&#8221;=&gt;array	(&#8221;Mango&#8221;,&#8221;Apple&#8221;,&#8221;Strawberry&#8221;),<br />
&#8220;Animals&#8221;=&gt;array	(&#8221;Lion&#8221;,&#8221;Tiger&#8221;),<br />
&#8220;Birds&#8221;=&gt;array	(&#8221;Eagle&#8221;,&#8221;Peacock&#8221;,&#8221;Penguin&#8221;)<br />
);</p>
<p>The arrays and sub-arrays can be referred to as</p>
<p>$families['Fruit'][2]  will refer to Strawberry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with String variables</title>
		<link>http://www.goweb99.com/blog/php-tutorial/working-with-string-variables/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/working-with-string-variables/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 11:41:26 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php strings]]></category>
		<category><![CDATA[php strlen() function]]></category>
		<category><![CDATA[php strpos() function]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=382</guid>
		<description><![CDATA[A string variable is used to store and manipulate character strings.
PHP provides some pre defined functions to manipulate string variables. There are someoperators also which directly work on strings.
For eg:
&#60;?php
$txt=&#8221;Its PHP&#8221;;
echo $txt;
?&#62;

Output:
Its PHP
We can use strings directly within double quotes or we can assign them to some variable and can use them through variables.
The Concatenation [...]]]></description>
			<content:encoded><![CDATA[<p>A string variable is used to store and manipulate character strings.</p>
<p>PHP provides some pre defined functions to manipulate string variables. There are someoperators also which directly work on strings.</p>
<div class="example">For eg:</p>
<p>&lt;?php<br />
$txt=&#8221;Its PHP&#8221;;<br />
echo $txt;<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>Its PHP</p></div>
<p>We can use strings directly within double quotes or we can assign them to some variable and can use them through variables.</p>
<p><strong>The Concatenation Operator</strong></p>
<p>PHP provides an operator to manipulate string variables directly. This is called the concatenation operator represented by a “.” (dot).<br />
The concatenation operator (.), as the name implies, concatenates two strings, ie it joins two or more strings.</p>
<div class="example">For eg:</p>
<p>&lt;?php<br />
$txt1=&#8221;Its PHP!&#8221;;<br />
$txt2=&#8221; So easy to use!&#8221;;<br />
echo $txt1 . $txt2;<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>Its PHP! So easy to use!</p></div>
<p><strong>The strlen() function</strong></p>
<p>Like in other languages PHP defines the strlen() function, which returns the length of a string.</p>
<div class="example">For eg:</p>
<p>&lt;?php<br />
echo strlen(&#8221;Its PHP!&#8221;);<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>8</p></div>
<p>This function can be useful in various string operations like matching two strings or finding some string in a large text where the loop counter should iterate till the last character of the text only. Various other applications can also use this function.</p>
<p><strong>The strpos() function</strong></p>
<p>The strpos() function searches a given character within a string.</p>
<p>If the character is found, this function will return the position of the first match. If no match is found, it will return FALSE.</p>
<div class="example">For eg:</p>
<p>&lt;?php<br />
echo strpos(&#8221;Its PHP!&#8221;,&#8221;PHP&#8221;);<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>4</p></div>
<p>The position of the string &#8220;world&#8221; is 6, as the counter starts from 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/working-with-string-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using echo</title>
		<link>http://www.goweb99.com/blog/php-tutorial/using-echo/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/using-echo/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 10:33:57 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php echo]]></category>
		<category><![CDATA[php strings]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=376</guid>
		<description><![CDATA[As we used in previous pages, the PHP command echo is a way to uotput text to the web browser. Echo is the most commonly, and most ofetenly used command while working in PHP
We use echo to output a string. You can either use a variable or the string itself within quotes.
For eg:
&#60;?php
$myString = &#8220;PHP&#8221;;
echo [...]]]></description>
			<content:encoded><![CDATA[<p>As we used in previous pages, the PHP command echo is a way to uotput text to the web browser. Echo is the most commonly, and most ofetenly used command while working in PHP</p>
<p>We use echo to output a string. You can either use a variable or the string itself within quotes.</p>
<div class="example">For eg:</p>
<p>&lt;?php<br />
$myString = &#8220;PHP&#8221;;<br />
echo $myString;<br />
echo &#8220;&lt;h5&gt;PHP is too good!&lt;/h5&gt;&#8221;;<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>PHP<br />
PHP is too good!</p></div>
<p>The text that we output through echo is sent to the user in the form of a web page. So we can also use HTML tags inside the echo command,</p>
<p><strong>Careful When Echoing Quotes!</strong></p>
<p>It seems very good to be able to output HTML with PHP. However, you must be careful when using HTML code, when it contains quotes. Echo uses quotes to mark the beginning and end of the string, so you must not use quotes other than at the starting and the ending. If its necessary to use quotes inside echo you must use one of these methods</p>
<p>Use escape sequence to escape your quotes from echo ie just put a backslash directly before the quotation mark, like  \&#8221;</p>
<p>Use single quotes (apostrophes) for quotes inside your string like ‘    ’.</p>
<div class="example">&lt;?php<br />
Echo “&lt;h5 class=”specialH5”&gt;I Love PHP!&lt;/h5&gt;		//doesn’t work<br />
echo &#8220;&lt;h5 class=\&#8221;specialH5\&#8221;&gt;I love using PHP!&lt;/h5&gt;&#8221;;	//works<br />
?&gt;</div>
<p><strong>Echoing Variables</strong></p>
<p>While echoing variables in PHP no quotations are required. They are written directly with echo as:</p>
<div class="example">For eg:</p>
<p>&lt;?php<br />
$my_string = &#8220;PHP is too good  &#8221;;<br />
$my_number = 4;<br />
$my_letter = U;<br />
echo $my_string;<br />
echo $my_number;<br />
echo $my_letter;<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>PHP is too good 4U</p></div>
<p><strong>Echoing Variables and Text Strings</strong></p>
<p>You can also place variables inside of double-quoted strings. This tells the PHP interpreter to output the string value of the variable to be printed in the place of the variable.</p>
<div class="example">
For eg:</p>
<p>&lt;?php<br />
$my_string = &#8220;PHP is too good&#8221;;<br />
echo &#8220;$my_string to use &lt;br /&gt;&#8221;;<br />
echo &#8220;PHP is a scripting language $my_string &lt;br /&gt;&#8221;;<br />
echo &#8220;PHP is a scripting language $my_string to use&#8221;;<br />
?&gt;</p></div>
<div class="example">
Output:</p>
<p>PHP is too good to use<br />
PHP is a scripting language PHP is too good<br />
PHP is a scripting language PHP is too good to use</p></div>
<p>Using variables saves time and provide reusability, you don’t need to retype the whole string over and again whenever you want to use it. With variables you can just use the variable whrever theres a need to use the same variable. It makes the code readable.</p>
<p>You should always use double quotes with string variables, as single quotes will not give the value of the string rather it will just print the variable name like</p>
<p>$my_string</p>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/using-echo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Variables</title>
		<link>http://www.goweb99.com/blog/php-tutorial/php-variables/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/php-variables/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 08:58:50 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP Tuts]]></category>
		<category><![CDATA[php variables]]></category>
		<category><![CDATA[whitespace in php]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=371</guid>
		<description><![CDATA[A variable is something whose value can be changing, or the other way round, a variable is used to store some values which are not constant. These values can be anything, like string, any integer value etc.
After declaring a variable you can use it again and again in your script.
Variables are declared using a $ [...]]]></description>
			<content:encoded><![CDATA[<p>A variable is something whose value can be changing, or the other way round, a variable is used to store some values which are not constant. These values can be anything, like string, any integer value etc.</p>
<p>After declaring a variable you can use it again and again in your script.</p>
<p>Variables are declared using a $ sign. In PHP variables are typed according to the value they contain, so we don’t write any type specifier while declaring a variable.</p>
<ul>
$var_name = value;</ul>
<p>If you forget putting a dollar sign before the name of a variable, it won’t work in PHP</p>
<p>PHP is a Loosely Typed Language.It internally converts a variable to the same type as the data type of its value. You can declare a variable only when you need one. No previous declaration is needed.</p>
<p><strong>Naming Rules for Variables</strong></p>
<p>PHP has variable declaration rules similar to other programming languages:</p>
<ul>
<li>variable name can only start with a letter or an underscore &#8220;_&#8221;</li>
<li>variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, and _ )</li>
<li>variable name can not have spaces. If a variable name is of more than one word, it should be separated with an underscore, or with capitalization<br />
like   “$my_string”  or   “$myString”</li>
</ul>
<p>Like other programming languages, variable names in PHP also are case-sensitive, so be sure to use the exact capitalization when using a variable. The variables $a_number and $A_number are different variables in PHP.</p>
<p><strong>White Space</strong></p>
<p>Like HTML, whitespaces are ignored in PHP. You can put any number of whitespaces may be to properly indent your code, and all the whitespaces will be ignored by the PHP interpreter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/php-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding PHP in HTML</title>
		<link>http://www.goweb99.com/blog/php-tutorial/embedding-php-in-html/</link>
		<comments>http://www.goweb99.com/blog/php-tutorial/embedding-php-in-html/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 07:54:58 +0000</pubDate>
		<dc:creator>tutor</dc:creator>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[PHP in HTML]]></category>
		<category><![CDATA[PHP Tuts]]></category>

		<guid isPermaLink="false">http://www.goweb99.com/blog/?p=355</guid>
		<description><![CDATA[PHP is almost always used with HTML. PHP scripts are embedded inside HTML pages anywhere in the body section.
A simple HTML page with PHP scripts looks like this:
&#60;html&#62;
&#60;head&#62;
&#60;title&#62; Embedding PHP in HTML&#60;/title&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;?php
echo ”It&#8217;s so good to be here!!!”;
?&#62;
&#60;/body&#62;
&#60;/html&#62;
Output:
It&#8217;s so good to be here!!!
Echo is a PHP command to output string on the web page.
Echo is [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is almost always used with HTML. PHP scripts are embedded inside HTML pages anywhere in the body section.</p>
<p>A simple HTML page with PHP scripts looks like this:</p>
<div class="example">&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt; Embedding PHP in HTML&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
echo ”It&#8217;s so good to be here!!!”;<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<div class="example">Output:</p>
<p>It&#8217;s so good to be here!!!</p></div>
<p>Echo is a PHP command to output string on the web page.<br />
Echo is a vast topic so we will be discussing it later in this tutorial.</p>
<p><strong>The Semicolon</strong></p>
<p>Each line of PHP code ends with a semicolon. Semicolon is the PHP delimiter.</p>
<p>PHP will show an error if the semicolon is missed in any line.</p>
<p>echo ”It&#8217;s so good to be here!!!”;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.goweb99.com/blog/php-tutorial/embedding-php-in-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
