<?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>benedikt.valdez</title>
	<atom:link href="http://www.benediktvaldez.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.benediktvaldez.com</link>
	<description>valdez designs</description>
	<lastBuildDate>Sun, 26 Sep 2010 00:22:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Update multiple rows at once</title>
		<link>http://www.benediktvaldez.com/archives/59</link>
		<comments>http://www.benediktvaldez.com/archives/59#comments</comments>
		<pubDate>Sun, 26 Sep 2010 00:22:55 +0000</pubDate>
		<dc:creator>benediktvaldez</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[update multiple]]></category>

		<guid isPermaLink="false">http://www.benediktvaldez.com/?p=59</guid>
		<description><![CDATA[Simple way to update multiple rows at once. Form $i=0; while(**){ $i++;} Update $size = count($_POST['ID']); $i=0; while ($i < $size) { $ID=$_POST['ID'][$i]; $name=$_POST['name'][$i]; $src=$_POST['src'][$i]; $Update="UPDATE band_myndir [...]]]></description>
			<content:encoded><![CDATA[<p>Simple way to update multiple rows at once.</p>
<p>Form</p>
<pre class="brush:php">
$i=0;
while(**){
<input name="ID[$i]" />
<input name="name[$i]" />
<input name="src[$i]" />
$i++;}
</pre>
<p>Update</p>
<pre class="brush:php">
$size = count($_POST['ID']);
$i=0;
while ($i < $size) {
    $ID=$_POST['ID'][$i];
    $name=$_POST['name'][$i];
    $src=$_POST['src'][$i];
	$Update="UPDATE band_myndir SET
		 name='$name'
		,src='$src'
			WHERE ID='$ID'";
$i++;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.benediktvaldez.com/archives/59/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A few missing PHP functions</title>
		<link>http://www.benediktvaldez.com/archives/43</link>
		<comments>http://www.benediktvaldez.com/archives/43#comments</comments>
		<pubDate>Sun, 21 Feb 2010 00:56:28 +0000</pubDate>
		<dc:creator>benediktvaldez</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[excerpt()]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[left()]]></category>
		<category><![CDATA[mid()]]></category>
		<category><![CDATA[right()]]></category>

		<guid isPermaLink="false">http://www.benediktvaldez.com/?p=43</guid>
		<description><![CDATA[Not that these are any invention of mine, but I've kind of gathered them and made them a default on most of my projects.]]></description>
			<content:encoded><![CDATA[<p>Not that these are any invention of mine, but I&#8217;ve kind of gathered them and made them a default on most of my projects.<br />
Feel free to use them as you wish.</p>
<p>The first three or kind of self-explanatory</p>
<pre class="brush:php">function right($value, $count) {
return substr($value, ($count*-1));
}</pre>
<pre class="brush:php">function mid($string, $start, $count) {
return substr($string, $start, $count);
}</pre>
<pre class="brush:php">function left($string, $count) {
return substr($string, 0, $count);
}</pre>
<p>The <code>excerpt()</code> function is very useful when you need to take the first X number of characters from an input.</p>
<pre class="brush:php">function excerpt($input, $length, $trailing='...', $trail = true, $strip = true) {
if ($strip) {
$input = strip_tags($input);
}
if (strlen($input) &lt;= $length) {
return strip_tags($input);
}
$last_space = strrpos(substr($input, 0, $length), ' ');
$trimmed_text = substr($input, 0, $last_space);
if ($trail) {
$trimmed_text .= $trailing;
}
return $trimmed_text;
}</pre>
<p>The required inputs are <code>$input</code> and <code>$length</code>, but <code>$trailing</code>, <code>$trail</code> and <code>$strip</code> have default values and are therefore optional. The default trailing is &#8216;&#8230;&#8217;, and both <code>$trail</code> and <code>$strip</code> are <code>true</code> by default.</p>
<p>The function first strips the <code>$input</code> and checks it&#8217;s length. If it exceeds the maximum desired length (<code>$length</code>), than we will cut the <code>$input</code> at it&#8217;s last space (so we won&#8217;t cut through a word) and,if <code>$trail</code> is <code>true</code>, add <code>$trailing</code> to the end.</p>
<p>Example of simple usage:</p>
<pre class="brush:php">$news="This is a long news story which I would like to excerpt the first 20 characters from.";

print excerpt($news,'20');
</pre>
<p>Would return: &#8220;This is a long news &#8230;&#8221;<br />
Feel free to play around with these functions, and please post your ideas or comments here for all to benefit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benediktvaldez.com/archives/43/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use GET data with PHP include</title>
		<link>http://www.benediktvaldez.com/archives/37</link>
		<comments>http://www.benediktvaldez.com/archives/37#comments</comments>
		<pubDate>Sun, 21 Feb 2010 00:47:11 +0000</pubDate>
		<dc:creator>benediktvaldez</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[include]]></category>

		<guid isPermaLink="false">http://www.benediktvaldez.com/?p=37</guid>
		<description><![CDATA[While working on many of my projects, I have stumbled upon the same problem frequently when including files; PHP won’t allow you to pass GET values in the filename.]]></description>
			<content:encoded><![CDATA[<p>While working on many of my projects, I have stumbled upon the same problem frequently when including files; PHP won’t allow you to pass GET values in the filename:</p>
<pre class="brush:php">include('file.php?get=data'); // will not work</pre>
<p>While looking for an easy work around, &#8217;cause lets face it, I don&#8217;t have time to overhaul the entire script, I found this neat little trick:</p>
<pre class="brush:php">$_GET['get'] = 'data';
include('file.php);</pre>
<p>Simply set the GET information manually before including the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benediktvaldez.com/archives/37/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lindyravers.com</title>
		<link>http://www.benediktvaldez.com/archives/16</link>
		<comments>http://www.benediktvaldez.com/archives/16#comments</comments>
		<pubDate>Sat, 23 Jan 2010 12:31:46 +0000</pubDate>
		<dc:creator>benediktvaldez</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[lindy hop]]></category>
		<category><![CDATA[lindy ravers]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://www.benediktvaldez.com/?p=16</guid>
		<description><![CDATA[Lindy Ravers is an Icelandic group of Lindy Hop dancers, which meet regularly for lessons and just plain fun. The project involved a logo design and integrating the layout [...]]]></description>
			<content:encoded><![CDATA[<p><a title="the Lindy Ravers website" href="http://www.lindyravers.com" target="_blank">Lindy Ravers</a> is an Icelandic group of Lindy Hop dancers, which meet regularly for lessons and just plain fun.</p>
<p>The project involved a logo design and integrating the layout into <a title="wordpress.org" href="http://www.wordpress.org" target="_blank">WordPress</a>.</p>
<p>Lindy Hop, for those not familiar with the term, is based on the popular Charleston and named for Charles Lindbergh&#8217;s Atlantic crossing in 1927. It evolved in New York City in the 1920s and &#8217;30s and originally evolved with the jazz music of that time. Lindy was a fusion of many dances that preceded it or were popular during its development but is mainly based on jazz, tap, breakaway and Charleston. It is frequently described as a jazz dance and is a member of the swing dance family. (For more info: <a title="Lindy Hop at wikipeda.org" href="http://en.wikipedia.org/wiki/Lindyhop" target="_blank">wikipedia.org</a>)</p>
<p>So if your in Iceland and your up for some upbeat dancing, sweating and some crazy fun, check out the <a title="the Lindy Ravers website" href="http://www.lindyravers.com" target="_blank">Lindy Ravers</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benediktvaldez.com/archives/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>arcticlindy.com</title>
		<link>http://www.benediktvaldez.com/archives/13</link>
		<comments>http://www.benediktvaldez.com/archives/13#comments</comments>
		<pubDate>Sat, 23 Jan 2010 12:28:44 +0000</pubDate>
		<dc:creator>benediktvaldez</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arcticlindy]]></category>
		<category><![CDATA[lindy hop]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://www.benediktvaldez.com/?p=13</guid>
		<description><![CDATA[arcticlindy.com is a bilingual promotional website for an international Lindy Hop dance festival in Iceland. The first festival was held in August 2009, and will be repeated [...]]]></description>
			<content:encoded><![CDATA[<p>arcticlindy.com is a bilingual promotional website for an international Lindy Hop dance festival in Iceland. The first festival was held in August 2009, and will be repeated yearly from now on due to great attendance.</p>
<p>This project involved designing the identity, webdesign and development.</p>
<p>If you are interesting in visiting Iceland and joining some crazy dancers, check out <a title="arcticlindy.com" href="http://www.arcticlindy.com" target="_blank">arcticlindy.com</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benediktvaldez.com/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>icelandexpo.is</title>
		<link>http://www.benediktvaldez.com/archives/3</link>
		<comments>http://www.benediktvaldez.com/archives/3#comments</comments>
		<pubDate>Sat, 23 Jan 2010 02:41:21 +0000</pubDate>
		<dc:creator>benediktvaldez</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[icelandic design and handcraft]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://www.benediktvaldez.com/?p=3</guid>
		<description><![CDATA[A promotional website for icelandic handcraft and design. This project involved Identity, business card design, webdesign and development.]]></description>
			<content:encoded><![CDATA[<p>A promotional website for icelandic handcraft and design. This project involved Identity, business card design, webdesign and development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benediktvaldez.com/archives/3/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

