<?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 strings</title>
	<atom:link href="http://www.goweb99.com/blog/tag/php-strings/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>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>
	</channel>
</rss>
