<?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>Vdiscussion &#187; HTML</title>
	<atom:link href="http://vdiscussion.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://vdiscussion.com</link>
	<description>Vinoth Kumar&#039;s Discussion</description>
	<lastBuildDate>Wed, 09 Dec 2009 15:34:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>How to break a string into pieces in PHP</title>
		<link>http://vdiscussion.com/how-to-break-a-string-into-pieces-in-php/</link>
		<comments>http://vdiscussion.com/how-to-break-a-string-into-pieces-in-php/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 18:16:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Programs]]></category>
		<category><![CDATA[break a string into pieces]]></category>
		<category><![CDATA[explode( )]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Perl-compatible]]></category>
		<category><![CDATA[POSIX]]></category>
		<category><![CDATA[preg_split( )]]></category>
		<category><![CDATA[split( )]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=130</guid>
		<description><![CDATA[You need to break a string into pieces. For example, you want to access each line that a user enters in a &#60;textarea&#62; form field. Use explode( ) if what separates the pieces is a constant string: &#60;?php $words = explode(&#8216; &#8216;,&#8217;My sentence is not very complicated&#8217;); ?&#62; Use split( ) or preg_split( ) if [...]]]></description>
			<content:encoded><![CDATA[<p>You need to break a string into pieces. For example, you want to access each line that a user enters in a <tt>&lt;textarea&gt;</tt> form field.<br />
Use <em>explode( )</em> if what separates the pieces is a constant string:</p>
<blockquote><p>
&lt;?php<br />
$words = explode(&#8216; &#8216;,&#8217;My sentence is not very complicated&#8217;);<br />
?&gt;</p></blockquote>
<p>Use <em>split( ) </em>or <em>preg_split( )</em> if you need a POSIX or Perl-compatible regular expression to describe the separator:</p>
<blockquote><p>
&lt;?php<br />
$words = split(&#8216; +&#8217;,'This sentence  has  some extra whitespace  in it.&#8217;);<br />
$words = preg_split(&#8216;/\d\. /&#8217;,'my day: 1. get up 2. get dressed 3. eat toast&#8217;);<br />
$lines = preg_split(&#8216;/[\n\r]+/&#8217;,$_REQUEST['textarea']);<br />
?&gt;</p></blockquote>
<p>Use <em>spliti( )</em> or the /i flag to <em>preg_split( )</em> for case-insensitive separator matching:</p>
<blockquote><p>
&lt;?php<br />
$words = spliti(&#8216; x &#8216;,&#8217;31 inches x 22 inches X 9 inches&#8217;);<br />
$words = preg_split(&#8216;/ x /i&#8217;,&#8217;31 inches x 22 inches X 9 inches&#8217;);<br />
?&gt;</p></blockquote>
<p>The simplest solution of the bunch is <em>explode( )</em>. Pass it your separator string, the string to be separated, and an optional limit on how many elements should be returned:</p>
<blockquote><p>&lt;?php<br />
$dwarves = &#8216;dopey,sleepy,happy,grumpy,sneezy,bashful,doc&#8217;;<br />
$dwarf_array = explode(&#8216;,&#8217;,$dwarves);<br />
?&gt;</p></blockquote>
<p>This makes $dwarf_array a seven-element array, so print_r($dwarf_array) prints:<br />
Array<br />
(<br />
[0] =&gt; dopey<br />
[1] =&gt; sleepy<br />
[2] =&gt; happy<br />
[3] =&gt; grumpy<br />
[4] =&gt; sneezy<br />
[5] =&gt; bashful<br />
[6] =&gt; doc<br />
)</p>
<p>If the specified limit is less than the number of possible chunks, the last chunk contains the remainder:</p>
<blockquote><p>&lt;?php<br />
$dwarf_array = explode(&#8216;,&#8217;,$dwarves,5);<br />
print_r($dwarf_array);<br />
?&gt;</p></blockquote>
<p>This prints:<br />
Array<br />
(<br />
[0] =&gt; dopey<br />
[1] =&gt; sleepy<br />
[2] =&gt; happy<br />
[3] =&gt; grumpy<br />
[4] =&gt; sneezy,bashful,doc<br />
)</p>
<p>The separator is treated literally by <em>explode( )</em>. If you specify a comma and a space as a separator, it breaks the string only on a comma followed by a space, not on a comma or a space.<br />
With <em>split( )</em>, you have more flexibility. Instead of a string literal as a separator, it uses a POSIX regular expression:</p>
<blockquote><p>&lt;?php<br />
$more_dwarves = &#8216;cheeky,fatso, wonder boy, chunky,growly, groggy, winky&#8217;;<br />
$more_dwarf_array = split(&#8216;, ?&#8217;,$more_dwarves);<br />
?&gt;</p></blockquote>
<p>This regular expression splits on a comma followed by an optional space, which treats all the new dwarves properly. A dwarf with a space in his name isn&#8217;t broken up, but everyone is broken apart whether they are separated by &#8220;,&#8221; or &#8220;, &#8220;. print_r($more_dwarf_array) prints:<br />
Array<br />
(<br />
[0] =&gt; cheeky<br />
[1] =&gt; fatso<br />
[2] =&gt; wonder boy<br />
[3] =&gt; chunky<br />
[4] =&gt; growly<br />
[5] =&gt; groggy<br />
[6] =&gt; winky<br />
)</p>
<p>Similar to <em>split( )</em> is <em>preg_split( )</em>, which uses a Perl-compatible regular expression engine instead of a POSIX regular expression engine. With <em>preg_split( )</em>, you can take advantage of various Perl-ish regular expression extensions, as well as tricks such as including the separator text in the returned array of strings:</p>
<blockquote><p>&lt;?php<br />
$math = &#8220;3 + 2 / 7 &#8211; 9&#8243;;<br />
$stack = preg_split(&#8216;/ *([+\-\/*]) */&#8217;,$math,-1,PREG_SPLIT_DELIM_CAPTURE);<br />
print_r($stack);<br />
?&gt;</p></blockquote>
<p>This prints:<br />
Array<br />
(<br />
[0] =&gt; 3<br />
[1] =&gt; +<br />
[2] =&gt; 2<br />
[3] =&gt; /<br />
[4] =&gt; 7<br />
[5] =&gt; -<br />
[6] =&gt; 9<br />
)</p>
<p>The separator regular expression looks for the four mathematical operators (+, -, /, *), surrounded by optional leading or trailing spaces. The PREG_SPLIT_DELIM_CAPTURE flag tells <em>preg_split( )</em> to include the matches as part of the separator regular expression in parentheses in the returned array of strings. Only the mathematical operator character class is in parentheses, so the returned array doesn&#8217;t have any spaces in it.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/how-to-break-a-string-into-pieces-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Trim Blanks from a String using PHP</title>
		<link>http://vdiscussion.com/how-to-trim-blanks-from-a-string-using-php/</link>
		<comments>http://vdiscussion.com/how-to-trim-blanks-from-a-string-using-php/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 18:12:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Programs]]></category>
		<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[chomp( )]]></category>
		<category><![CDATA[chop( )]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[ltrim( )]]></category>
		<category><![CDATA[rtrim( )]]></category>
		<category><![CDATA[trim( )]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=123</guid>
		<description><![CDATA[Use ltrim( ), rtrim( ), or trim( ), ltrim( ) removes whitespace from the beginning of a string, rtrim( ) from the end of a string, and trim( ) from both the beginning and end of a string: &#60;?php $zipcode = trim($_REQUEST['zipcode']); $no_linefeed = rtrim($_REQUEST['text']); $name = ltrim($_REQUEST['name']); ?&#62; For these functions, whitespace is defined [...]]]></description>
			<content:encoded><![CDATA[<p>Use <em>ltrim( ), rtrim( )</em>, or <em>trim( ),</em> <em>ltrim( )</em> removes whitespace from the beginning of a string, <em>rtrim( )</em> from the end of a string, and <em>trim( )</em> from both the beginning and end of a string:</p>
<blockquote>
<pre>&lt;?php
$zipcode = trim($_REQUEST['zipcode']);
$no_linefeed = rtrim($_REQUEST['text']);
$name = ltrim($_REQUEST['name']);
?&gt;</pre>
</blockquote>
<pre>For these functions, whitespace is defined as the following
characters:newline, carriage return, space, horizontal and
vertical tab, and null .</pre>
<p>Trimming whitespace off of strings saves storage space and canmake for more<br />
precise display of formatted data or text within<tt>&lt;pre&gt;</tt> tags, for example. If<br />
you are doing comparisons with userinput, you should trim the data first, so<br />
that someone who mistakenly enters&#8221;98052&#8243; as their zip code isn&#8217;t forced to<br />
fix an error that really isn&#8217;t one. Trimming before exact text comparisons<br />
also ensures that, for example, &#8220;salami\n&#8221; equals &#8220;salami.&#8221; It&#8217;s also a good<br />
idea to normalize string data bytrimming it before storing it in a database.</p>
<p>The <em>trim( )</em> functions can also remove user-specifiedcharacters from strings.<br />
Pass the characters you want to remove as a secondargument. You can indicate<br />
a range of characters with two dots between the firstand last characters in<br />
the range:</p>
<blockquote>
<pre>&lt;?php
// Remove numerals and space from the beginning of the line
print ltrim('10 PRINT A$',' 0..9');
// Remove semicolon from the end of the line
print rtrim('SELECT * FROM turtles;',';');
?&gt;</pre>
</blockquote>
<p>This prints:</p>
<blockquote>
<pre>PRINT A$</pre>
<pre>SELECT * FROM turtles</pre>
</blockquote>
<p>PHP also provides <em>chop( ) </em>asan alias for <em>rtrim( )</em>. However, you&#8217;re best off<br />
using <em>rtrim( )</em> instead because PHP&#8217;s <em>chop( )</em> behaves differently than Perl&#8217;s<br />
<em>chop( )</em> (which is deprecated in favor of<em> chomp( )</em> , anyway), and using it can<br />
confuse others when they read your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/how-to-trim-blanks-from-a-string-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interpolating Functions and Expressions Within Strings Using PHP</title>
		<link>http://vdiscussion.com/interpolating-functions-and-expressions-within-strings-using-php/</link>
		<comments>http://vdiscussion.com/interpolating-functions-and-expressions-within-strings-using-php/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 18:04:59 +0000</pubDate>
		<dc:creator>Dora_david</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Software Programs]]></category>
		<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Interpolating Functions]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=120</guid>
		<description><![CDATA[You can put variables, object properties, and array elements (if the subscript is unquoted) directly in double-quoted strings: &#60;?php print "I have $children children."; print "You owe $amounts[payment] immediately."; print "My circle's diameter is $circle-&#62;diameter inches."; ?&#62; Interpolation with double-quoted strings places some limitations on the syntax of what can be interpolated. In the previous [...]]]></description>
			<content:encoded><![CDATA[<p>You can put variables, object properties, and array elements  (if the subscript is unquoted) directly in double-quoted strings:</p>
<blockquote>
<pre>&lt;?php
print "I have $children children.";
print "You owe $amounts[payment] immediately.";
print "My circle's diameter is $circle-&gt;diameter inches.";
?&gt;</pre>
</blockquote>
<p>Interpolation with double-quoted strings places some  limitations on the syntax of what can be interpolated. In the previous example,  <tt>$amounts['payment']</tt> had to be written as <tt>$amounts[payment]</tt> so  it would be interpolated properly. Use <a name="IDX-CH-01-080"></a><a name="IDX-CH-01-081"></a>curly braces around more complicated expressions to  interpolate them into a string. For example:</p>
<blockquote>
<pre>&lt;?php
print "I have less than {$children} children.";
print "You owe {$amounts['payment']} immediately.";
print "My circle's diameter is {$circle-&gt;getDiameter()} inches.";
?&gt;</pre>
</blockquote>
<p>Direct interpolation or using string concatenation also works  with heredocs. Interpolating with string concatenation in heredocs can look a  little strange because the closing heredoc<a name="IDX-CH-01-082"></a> delimiter  and the string concatenation operator have to be on separate lines:</p>
<blockquote>
<pre>&lt;?php
print &lt;&lt;&lt; END
Right now, the time is
END
. strftime('%c') . &lt;&lt;&lt; END
 but tomorrow it will be
END
. strftime('%c',time() + 86400);
?&gt;</pre>
</blockquote>
<p>Also, if you&#8217;re interpolating with heredocs, make sure to  include appropriate spacing for the whole string to appear properly. In the  previous example, <tt>Right now the time</tt> has to include a trailing space,  and <tt>but tomorrow it will be</tt> has to include leading and trailing  spaces.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/interpolating-functions-and-expressions-within-strings-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to capitalize, lowercase letters in a string using PHP</title>
		<link>http://vdiscussion.com/how-to-capitalize-lowercase-letters-in-a-string-using-php/</link>
		<comments>http://vdiscussion.com/how-to-capitalize-lowercase-letters-in-a-string-using-php/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Programs]]></category>
		<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[strtolower( )]]></category>
		<category><![CDATA[strtoupper( )]]></category>
		<category><![CDATA[ucfirst( )]]></category>
		<category><![CDATA[ucwords( )]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=117</guid>
		<description><![CDATA[Use ucfirst( ) to capitalize the first character in a string: &#60;?php print ucfirst(&#8216;monkey face&#8217;); print ucfirst(&#8217;1 monkey face&#8217;); ?&#62; Output: Monkey face 1 monkey face Note that the second phrase is not &#8220;1 Monkey face.&#8221; Use ucwords( ) to capitalize the first character of each word in a string: &#60;?php print ucwords(&#8217;1 monkey face&#8217;); [...]]]></description>
			<content:encoded><![CDATA[<p>Use <em>ucfirst( )</em> to capitalize the first character in a string:</p>
<blockquote><p>&lt;?php<br />
print ucfirst(&#8216;monkey face&#8217;);<br />
print ucfirst(&#8217;1 monkey face&#8217;);<br />
?&gt;</p>
<p><strong>Output:</strong></p>
<p>Monkey face<br />
1 monkey face</p></blockquote>
<p><em>Note that the second phrase is not &#8220;1 Monkey face.&#8221;</em></p>
<p>Use <em>ucwords( )</em> to capitalize the first character of each word in a string:</p>
<blockquote><p>&lt;?php<br />
print ucwords(&#8217;1 monkey face&#8217;);<br />
print ucwords(&#8220;don&#8217;t play zone defense against the philadelphia 76-ers&#8221;);<br />
?&gt;</p>
<p>Output:</p>
<p>1 Monkey Face<br />
Don&#8217;t Play Zone Defense Against The Philadelphia 76-ers</p></blockquote>
<p>As expected, <strong><em>ucwords( )</em></strong> doesn&#8217;t capitalize the &#8220;t&#8221; in &#8220;don&#8217;t.&#8221; But it also doesn&#8217;t capitalize the &#8220;e&#8221; in &#8220;76-ers.&#8221; For <em>ucwords( )</em>, a word is any sequence of nonwhitespace characters that follows one or more whitespace characters. Since both &#8216; and &#8211; aren&#8217;t whitespace characters, <em>ucwords( )</em> doesn&#8217;t consider the &#8220;t&#8221; in &#8220;don&#8217;t&#8221; or the &#8220;e&#8221; in &#8220;76-ers&#8221; to be word-starting characters.<br />
Both <em>ucfirst( )</em> and <em>ucwords( )</em> don&#8217;t change the case of non-first letters:</p>
<blockquote><p>&lt;?php<br />
print ucfirst(&#8216;macWorld says I should get an iBook&#8217;);<br />
print ucwords(&#8216;eTunaFish.com might buy itunaFish.Com!&#8217;);<br />
?&gt;</p>
<p><strong>Output:</strong><br />
MacWorld says I should get an iBook<br />
ETunaFish.com Might Buy ItunaFish.Com!</p></blockquote>
<p>The functions <em>strtolower( )</em> and <em>strtoupper( )</em> work on entire strings, not just individual characters. All alphabetic characters are changed to lowercase by <em>strtolower( )</em> and <em>strtoupper( )</em> changes all alphabetic characters to uppercase:</p>
<blockquote><p>&lt;?php<br />
print strtolower(&#8220;I programmed the WOPR and the TRS-80.&#8221;);<br />
print strtoupper(&#8216;&#8221;since feeling is first&#8221; is a poem by e. e. cummings.&#8217;);<br />
?&gt;</p>
<p><strong>Output:</strong><br />
i programmed the wopr and the trs-80.<br />
&#8220;SINCE FEELING IS FIRST&#8221; IS A POEM BY E. E. CUMMINGS.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/how-to-capitalize-lowercase-letters-in-a-string-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Switching tabs and spaces in PHP</title>
		<link>http://vdiscussion.com/how-to-switching-tabs-and-spaces-in-php/</link>
		<comments>http://vdiscussion.com/how-to-switching-tabs-and-spaces-in-php/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:41:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Programs]]></category>
		<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[pc_tab_expand( )]]></category>
		<category><![CDATA[pc_tab_unexpand( )]]></category>
		<category><![CDATA[str_replace( )]]></category>
		<category><![CDATA[Switching tabs and spaces in PHP]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=114</guid>
		<description><![CDATA[Use str_replace( ) to switch spaces to tabs or tabs to spaces Example &#60;?php $r = mysql_query(&#8220;SELECT message FROM messages WHERE id = 1&#8243;) or die(); $ob = mysql_fetch_object($r); $tabbed = str_replace(&#8216; &#8216;,&#8221;\t&#8221;,$ob-&#62;message); $spaced = str_replace(&#8220;\t&#8221;,&#8217; &#8216;,$ob-&#62;message); print &#8220;With Tabs: &#60;pre&#62;$tabbed&#60;/pre&#62;&#8221;; print &#8220;With Spaces: &#60;pre&#62;$spaced&#60;/pre&#62;&#8221;; ?&#62; Using str_replace( ) for conversion, however, doesn&#8217;t respect tab [...]]]></description>
			<content:encoded><![CDATA[<p>Use <strong><em>str_replace( )</em></strong><em> </em>to switch spaces to tabs or tabs to spaces<br />
Example</p>
<blockquote><p>&lt;?php<br />
$r = mysql_query(&#8220;SELECT message FROM messages WHERE id = 1&#8243;) or die();<br />
$ob = mysql_fetch_object($r);<br />
$tabbed = str_replace(&#8216; &#8216;,&#8221;\t&#8221;,$ob-&gt;message);<br />
$spaced = str_replace(&#8220;\t&#8221;,&#8217; &#8216;,$ob-&gt;message);<br />
print &#8220;With Tabs: &lt;pre&gt;$tabbed&lt;/pre&gt;&#8221;;<br />
print &#8220;With Spaces: &lt;pre&gt;$spaced&lt;/pre&gt;&#8221;;<br />
?&gt;</p></blockquote>
<p>Using <strong><em>str_replace( )</em></strong> for conversion, however, doesn&#8217;t respect tab stops. If<br />
you want tab stops every eight characters, a line beginning with a five-letter<br />
word and a tab should have that tab replaced with three spaces, not one.<br />
Use the <strong><em>pc_tab_expand( )</em></strong> function<br />
<strong>pc_tab_expand( )</strong></p>
<blockquote><p>&lt;?php<br />
function pc_tab_expand($text) {<br />
while (strstr($text,&#8221;\t&#8221;)) {<br />
$text = preg_replace_callback(&#8216;/^([^\t\n]*)(\t+)/m&#8217;,'pc_tab_expand_helper&#8217;, $text);<br />
}<br />
return $text;<br />
}<br />
function pc_tab_expand_helper($matches) {<br />
$tab_stop = 8;<br />
return $matches[1] .<br />
str_repeat(&#8216; &#8216;,strlen($matches[2]) *<br />
$tab_stop &#8211; (strlen($matches[1]) % $tab_stop));<br />
}<br />
$spaced = pc_tab_expand($ob-&gt;message);<br />
?&gt;</p></blockquote>
<p><strong>You can use the <em>pc_tab_unexpand( )</em> function to turn spaces back to tabs</strong><br />
<strong>pc_tab_unexpand( )</strong></p>
<blockquote><p>&lt;?php<br />
function pc_tab_unexpand($text) {<br />
$tab_stop = 8;<br />
$lines = explode(&#8220;\n&#8221;,$text);<br />
foreach ($lines as $i =&gt; $line) {<br />
// Expand any tabs to spaces<br />
$line = pc_tab_expand($line);<br />
$chunks = str_split($line, $tab_stop);<br />
$chunkCount = count($chunks);<br />
// Scan all but the last chunk<br />
for ($j = 0; $j &lt; $chunkCount &#8211; 1; $j++) {<br />
$chunks[$j] = preg_replace(&#8216;/ {2,}$/&#8217;,&#8221;\t&#8221;,$chunks[$j]);<br />
}<br />
// If the last chunk is a tab-stop&#8217;s worth of spaces<br />
// convert it to a tab; Otherwise, leave it alone<br />
if ($chunks[$chunkCount-1] == str_repeat(&#8216; &#8216;, $tab_stop)) {<br />
$chunks[$chunkCount-1] = &#8220;\t&#8221;;<br />
}<br />
// Recombine the chunks<br />
$lines[$i] = implode(&#8221;,$chunks);<br />
}<br />
// Recombine the lines<br />
return implode(&#8220;\n&#8221;,$lines);<br />
}<br />
$tabbed = pc_tab_unexpand($ob-&gt;message);<br />
?&gt;</p></blockquote>
<p>Both functions take a string as an argument and return the string appropriately modified.<br />
Each function assumes tab stops are every eight spaces, but that can be modified by changing the setting of the <tt>$tab_stop</tt> variable.<br />
The regular expression in <em>pc_tab_expand( )</em> matches both a group of tabs and all the text in a line before that group of tabs. It needs to match the text before the tabs because the length of that text affects how many spaces the tabs should be replaced with so that subsequent text is aligned with the next tab stop. The function doesn&#8217;t just replace each tab with eight spaces; it adjusts text after tabs to line up with tab stops.<br />
Similarly, <strong><em>pc_tab_unexpand( )</em></strong> doesn&#8217;t just look for eight consecutive spaces and then replace them with one tab character. It divides up each line into eight-character chunks and then substitutes ending whitespace in those chunks (at least two spaces) with tabs. This not only preserves text alignment with tab stops; it also saves space in the string.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/how-to-switching-tabs-and-spaces-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tags and Elements of HTML</title>
		<link>http://vdiscussion.com/tags-and-elements-of-html/</link>
		<comments>http://vdiscussion.com/tags-and-elements-of-html/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:57:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Elements of HTML]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tags of HTML]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=96</guid>
		<description><![CDATA[If you look at the first and last lines of the code for the last example, you will see pairs of angle brackets containing the letters &#60;html&#62;. The two brackets and all of the characters between them are known as a tag, and there are lots of tags in the example. All of the tags [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">If you look at the first and last lines of the code for the last example, you will see pairs of angle brackets containing the letters &lt;html&gt;. The two brackets and all of the characters between them are known as a tag, and there are lots of tags in the example. All of the tags in this example come in pairs; there are<br />
opening tags and closing tags. The closing tag is always slightly different than the opening tag in that it has a forward slash character before the characters &lt;/html&gt;.</p>
<p style="text-align: left;">
<div id="attachment_100" class="wp-caption alignnone" style="width: 319px"><img class="size-full wp-image-100" title="html" src="http://vdiscussion.com/wp-content/uploads/2009/11/html1.JPG" alt="html" width="309" height="91" /><p class="wp-caption-text">html</p></div>
<p style="text-align: left;">The special meaning these tags give is a description of the structure of the document. The opening tag says “This is the beginning of a heading” and the closing tag says “This is the end of a heading.”Without the markup, the words in the middle would just be another bit of text; it would not be clear that they formed the heading.<br />
Now look at the paragraph of text about the company; it is held between an opening &lt;p&gt; tag and a closing &lt;/p&gt; tag. And, you guessed it, the p stands for paragraph.</p>
<p style="text-align: left;">As you can see, the markup in this example actually describes what you will find between the tags, and the added meaning the tags give is describing the structure of the document. For example, between the opening &lt;p&gt; and closing &lt;/p&gt; tags are paragraphs and between the &lt;h1&gt; and &lt;/h1&gt; tags is a heading. Indeed, the whole HTML document is contained between opening &lt;html&gt; and closing &lt;/html&gt; tags.<br />
If you were wondering why there is a number 1 after the h , it is because in HTML and XHTML there are six levels of headings. A level 1 heading is sometimes used as the main heading for a document (such as a chapter title), which can then contain subheadings, with level 6 being the smallest. This allows you to structure your document appropriately with subheadings under the main heading.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/tags-and-elements-of-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sample HTML program discussion</title>
		<link>http://vdiscussion.com/sample-html-program-discussion/</link>
		<comments>http://vdiscussion.com/sample-html-program-discussion/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:51:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Software Programs]]></category>
		<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[HTML program]]></category>
		<category><![CDATA[Sample HTML program]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=93</guid>
		<description><![CDATA[HTML, or Hypertext Markup Language, is the most widely used language onWeb. As its name suggests, HTML is a markup language, which may sound complicated, although really you come across markup every day. Markup is just something you add to a document to give it special meaning; for example, when you use a highlighter pen [...]]]></description>
			<content:encoded><![CDATA[<p>HTML, or Hypertext Markup Language, is the most widely used language onWeb. As its name suggests, HTML is a markup language, which may sound complicated, although really you come across markup every day. Markup is just something you add to a document to give it special meaning; for example, when you use a highlighter pen you are marking up a document. When you are marking up a document for the Web, the special meaning you are adding indicates the structure of the document, and the markup indicates which part of the document is a heading, which parts are paragraphs, what belongs in a table, and so on. This markup in turn allows a Web browser to display your document appropriately.</p>
<p>When creating a document in a word processor, you can distinguish headings using a heading style (usually with a larger font) to indicate which part of the text is a heading. You can use the Enter (or Return) key to start a new paragraph. You can insert tables into your document, create bulleted lists,<br />
and so on. When marking documents up for the Web you are performing a very similar process. HTML and XHTML are the languages you use to tell aWeb browser where the heading is for aWeb page, what is a paragraph, what is part of a table and so on, so it can structure your document and render it properly. But what is the difference between HTML and XHTML?Well, first you should know that there are several versions of both HTML and XHTML, but don’t let that bother you—it all sounds a lot more complicated than it really is. Whereas there are several versions of HTML, each version just adds functionality on top of its predecessor (like a new version of some software might add some features or a new version of a dictionary might add a few extra words), or offers better ways of doing things that were already in earlier versions. So, you do not need to learn each version of HTML and XHTML, nor do you need to focus on one variation. This book teaches you all you need to know to writeWeb pages using HTML and XHTML. Indeed, as I mentioned in the Introduction, XHTML is just like the latest version of HTML, as you will see shortly (although to be accurate, while it is almost identical to the last version of HTML, it is technically HTML’s successor).</p>
<blockquote><p>Sample Code :</p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Vdiscussion: About Us&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h1&gt;About Vdiscussion.com&lt;/h1&gt;<br />
&lt;p&gt;Vdiscussion is free educational site<br />
&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Save this code as filename.html.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/sample-html-program-discussion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Style sheet linking in XML</title>
		<link>http://vdiscussion.com/style-sheet-linking-in-xml/</link>
		<comments>http://vdiscussion.com/style-sheet-linking-in-xml/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 12:28:10 +0000</pubDate>
		<dc:creator>ma.vinothkumar</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Style sheet]]></category>
		<category><![CDATA[Style sheet linking in XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=44</guid>
		<description><![CDATA[This technique, you link a style sheet to the XML document. A style sheet is a separate file that contains instructions for formatting the individual XML elements. You can use either a cascading style sheet (CSS)—which is also used for HTML pages—or an Extensible Stylesheet Language Transformations (XSLT) style sheet—which is considerably more powerful than [...]]]></description>
			<content:encoded><![CDATA[<p>This technique, you link a style sheet to the XML document. A style sheet is a separate file that contains instructions for formatting the individual XML elements. You can use either a cascading style sheet (CSS)—which is also used for HTML pages—or an Extensible Stylesheet Language Transformations (XSLT) style sheet—which is considerably more powerful than a CSS and is designed specifically for XML documents.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/style-sheet-linking-in-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Does XML Replace HTML ?</title>
		<link>http://vdiscussion.com/does-xml-replace-html/</link>
		<comments>http://vdiscussion.com/does-xml-replace-html/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 12:27:16 +0000</pubDate>
		<dc:creator>ma.vinothkumar</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Does XML Replace HTML]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=46</guid>
		<description><![CDATA[Currently, the answer to that question is no. HTML is still the primary language used to tell browsers how to display information on the Web. With Internet Explorer, the only practical way to dispense entirely with HTML when you display XML is to attach a cascading style sheet to the XML docu- ment and then [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, the answer to that question is no. HTML is still the primary language<br />
used to tell browsers how to display information on the Web.<br />
With Internet Explorer, the only practical way to dispense entirely with HTML<br />
when you display XML is to attach a cascading style sheet to the XML docu-<br />
ment and then open the document directly in the browser. However, using a cas-<br />
cading style sheet is a relatively restrictive method for displaying and working<br />
with XML. All the other methods you’ll learn in this book involve HTML. Data<br />
binding and XML DOM scripts both use HTML Web pages as vehicles for dis-<br />
playing XML documents. And with XSLT style sheets, you create templates that<br />
transform the XML document into HTML that tells the browser how to format<br />
and display the XML data.<br />
Rather than replacing HTML, XML is currently used in conjunction with<br />
HTML and vastly extends the capability of Web pages to:<br />
I Deliver virtually any type of document<br />
I Sort, filter, rearrange, find, and manipulate the information in<br />
other ways<br />
I Present highly structured information<br />
As the quotation at the beginning of the chapter states, XML was designed for<br />
interoperability with HTML.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/does-xml-replace-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is XML ?</title>
		<link>http://vdiscussion.com/what-is-xml/</link>
		<comments>http://vdiscussion.com/what-is-xml/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 12:24:37 +0000</pubDate>
		<dc:creator>ma.vinothkumar</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[SGML]]></category>
		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=42</guid>
		<description><![CDATA[XML stands for Extensible Markup Language, was defined by the XML Working Group of the World Wide Web Consortium (W3C). This group described the language as follows: The Extensible Markup Language (XML) is a subset of SGML&#8230;Its goal is to enable generic SGML to be served, received, and processed on the Web in the way [...]]]></description>
			<content:encoded><![CDATA[<p>XML  stands for Extensible Markup Language, was defined by the<br />
XML Working Group of the World Wide Web Consortium (W3C). This group<br />
described the language as follows:<br />
The Extensible Markup Language (XML) is a subset of SGML&#8230;Its<br />
goal is to enable generic SGML to be served, received, and processed<br />
on the Web in the way that is now possible with HTML. XML has been<br />
designed for ease of implementation and for interoperability with both<br />
SGML and HTML.</p>
<p>As you can see, XML is a markup language designed specifically for delivering<br />
information over the World Wide Web, just like HTML (Hypertext Markup<br />
Language), which has been the standard language used to create Web pages<br />
since the inception of the Web. Since we already have HTML, which continues<br />
to evolve to meet additional needs, you might wonder why we require a com-<br />
pletely new language for the Web.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
