<?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>Gabriel de Kadt &#187; HTML</title>
	<atom:link href="http://www.lazydada.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazydada.com</link>
	<description>Personal notes on Mac based web development and design.</description>
	<lastBuildDate>Tue, 30 Aug 2011 10:47:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Turn a text list into an HTML Select Option list with PHP</title>
		<link>http://www.lazydada.com/2011-02-03/list-to-html-select-option-list-with-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=list-to-html-select-option-list-with-php</link>
		<comments>http://www.lazydada.com/2011-02-03/list-to-html-select-option-list-with-php/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 17:53:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=884</guid>
		<description><![CDATA[Easy solution to this basic HTML coding need posted over at Stack Overflow by a random clever bloke. Thanks RCB. My only issue was with UTF-8 characters coming through garbled. Bodged a workaround using this encode entities plug-in for Dreamweaver.]]></description>
			<content:encoded><![CDATA[<p>Easy solution to this basic HTML coding need posted over at <a title="list to HTML select option list" href="http://stackoverflow.com/questions/4573883/convert-simple-list-into-html-select-list" target="_blank">Stack Overflo</a>w by a <a href="http://stackoverflow.com/users/220819/jacob-relkin" target="_blank">random clever bloke</a>. Thanks RCB.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

  $fc = file_get_contents('./test.txt');
  $fc = utf8_encode ( $fc );
	$lines = explode(&quot;\n&quot;, $fc);

  $html = '&lt;select&gt;';
  foreach($lines as $line)
     $html .= '&lt;option value=&quot;' . $line . '&quot;&gt;' . $line . '&lt;/option&gt;';

  $html .= '&lt;/select&gt;';
  echo $html;
?&gt;
</pre>
<p>My only issue was with UTF-8 characters coming through garbled. Bodged a workaround using this <a href="http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;extid=15427#" target="_blank">encode entities plug-in</a> for Dreamweaver.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2011-02-03/list-to-html-select-option-list-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Include an HTML file in a PHP variable</title>
		<link>http://www.lazydada.com/2010-05-12/include-an-html-file-in-a-php-variable/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=include-an-html-file-in-a-php-variable</link>
		<comments>http://www.lazydada.com/2010-05-12/include-an-html-file-in-a-php-variable/#comments</comments>
		<pubDate>Wed, 12 May 2010 09:38:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=663</guid>
		<description><![CDATA[I couldn&#8217;t get PHP to accept an HTML file include as the definition of a variable without throwing my templated page into disarray.  An answer came from the venerable desilva then checked with the php folk; use output  buffering (see example six in that last link): &#60;?php $string = get_include_contents('somefile.php'); function get_include_contents($filename) { if (is_file($filename)) { ob_start(); include $filename; $contents = ob_get_contents(); ob_end_clean(); return $contents; } [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t get PHP to accept an HTML file include as the definition of a variable without throwing my templated page into disarray.  An answer came from the <a href="http://www.desilva.biz/php/ob_start.html" target="_blank">venerable desilva</a> then checked with <a href="http://php.net/manual/en/function.include.php">the php folk</a>; use output  buffering (see example six in that last link):</p>
<pre class="phpcode">&lt;?php
$string = get_include_contents('somefile.php');

function get_include_contents($filename) {
 if (is_file($filename)) {
 ob_start();
 include $filename;
 $contents = ob_get_contents();
 ob_end_clean();
 return $contents;
 }
 return false;
}

?&gt;</pre>
<p>Also worth a look: <tt><a href="http://es2.php.net/manual/en/function.file-get-contents.php">file_get_contents</a></tt></p>
<p>Why? Because <a title="Text editor and web development in one window for Mac" href="http://www.panic.com/coda/" target="_blank">Coda</a>, my favourite Macintosh text editor+,  doesn&#8217;t do syntax highlighting of HTML for a PHP string. The site I&#8217;ve just finished for a <a title="Villa Mirador - large exclusive villa in marbella" href="http://www.villamiradormarbella.com/" target="_blank">high-end luxury villa in Marbella</a> I had a big block of HTML to include (and work on) for the images page&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2010-05-12/include-an-html-file-in-a-php-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to group items in HTML select menus</title>
		<link>http://www.lazydada.com/2009-11-29/how-to-group-items-in-html-select-menus/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-group-items-in-html-select-menus</link>
		<comments>http://www.lazydada.com/2009-11-29/how-to-group-items-in-html-select-menus/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 11:38:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=502</guid>
		<description><![CDATA[Here&#8217;s something I learnt last week, just as the title says: how to group items in an (x)HTML select drop down list. This trick, which I&#8217;d assumed was done with magic (or rather DHTML or JavaScript trickery), is actually very easy to achieve being straight forward HTML markup. [Found in a referenced post linked to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something I learnt last week, just as the title says: how to group items in an (x)HTML select drop down list. This trick, which I&#8217;d assumed was done with magic (or rather DHTML or JavaScript trickery), is actually very easy to achieve being straight forward HTML markup.</p>
<p>[Found in a referenced post linked to by <a href="http://www.d.umn.edu/itss/support/Training/Online/webdesign/">Laura Carlson's excellent [webdev] reference</a> pages (subscribe to the <a href="http://www.d.umn.edu/itss/support/Training/Online/webdesign/webdev_listserv.html">list server here</a>)&#8230;]</p>
<p>&#8230;the secret, as explained by &#8220;Web Teacher&#8221; <a href="http://www.webteacher.ws/2009/11/18/the-optgroup-in-html-select-forms/">here</a>, is simply to wrap the items you want to group  in the select list with</p>
<p><code>&lt;optgroup label="group_title"&gt;</code> and <code>&lt;/optgroup&gt;</code></p>
<p>Another good point made there is that to make a select list multiple choice you just need to add the attribute <code>multiple="multiple"</code> into the opening select tag (and make it clear to the users that this is the case as well as how to actually select mulitiple items&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-11-29/how-to-group-items-in-html-select-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
