<?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>Knowledge Sharing &#187; Script</title>
	<atom:link href="http://blog.danigunawan.com/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danigunawan.com</link>
	<description>"Say it... although a word..."</description>
	<lastBuildDate>Mon, 04 Jan 2010 10:17:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IF Construct in One Line Using PHP</title>
		<link>http://blog.danigunawan.com/programming/if-construct-in-one-line-using-php/</link>
		<comments>http://blog.danigunawan.com/programming/if-construct-in-one-line-using-php/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 03:49:49 +0000</pubDate>
		<dc:creator>Dagu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Condition]]></category>
		<category><![CDATA[Construct]]></category>
		<category><![CDATA[If]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://blog.danigunawan.com/?p=582</guid>
		<description><![CDATA[The if construct is one of the most important   features of many languages, PHP included.  It allows for   conditional execution of code fragments.  PHP features an   if structure that is similar to that of C:
if (expr)
   statement
The general format of if construct is like shown [...]


Related posts:<ol><li><a href='http://blog.danigunawan.com/linux/send-message-over-linux-console/' rel='bookmark' title='Permanent Link: Send Message Over Linux Console'>Send Message Over Linux Console</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The <em>if</em> construct is one of the most important   features of many languages, PHP included.  It allows for   conditional execution of code fragments.  PHP features an   <em>if</em> structure that is similar to that of C:</p>
<pre>if (expr)
   statement</pre>
<p>The general format of if construct is like shown below:</p>
<pre>if (expr1) {
   //  statement if expr 1 true
} else if (expr2) {
   // statement if expr 2 true
} else {
   // statement if expr 1 and 2 false
}</pre>
<p>You may find useful documentation about<em> </em><a title="if construct" href="http://us3.php.net/manual/en/control-structures.if.php" target="_blank"><em>if</em> construct</a>, <em><a title="else condition" href="http://us3.php.net/manual/en/control-structures.else.php" target="_blank">else</a> </em>and<em> <a title="else if" href="http://us3.php.net/manual/en/control-structures.elseif.php" target="_blank">else if</a> </em>in <a title="control structures" href="http://us3.php.net/manual/en/language.control-structures.php" target="_blank">php.net</a>.</p>
<p>But how if you only need two condition to produce a word or digit, and then save it into a variable or just echo it? You may write it like shown below:</p>
<pre>if ($status = '0')
   echo 'Draft';
else
   echo 'Published';</pre>
<p>In code example above, you need to write four lines. Compare with code shown below:</p>
<pre>echo $status == '0' ? 'Draft' : 'Published';</pre>
<p>The syntax is show below</p>
<pre>echo expr ? 'value if true' : 'value if false';</pre>
<p>You may change echo with variable assignment such as:</p>
<pre>$var = expr ? 'value if true' : 'value if false';</pre>
<p>Easy right? It cuts down four lines into one line only.</p>


<p>Related posts:<ol><li><a href='http://blog.danigunawan.com/linux/send-message-over-linux-console/' rel='bookmark' title='Permanent Link: Send Message Over Linux Console'>Send Message Over Linux Console</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.danigunawan.com/programming/if-construct-in-one-line-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flying Skull Head</title>
		<link>http://blog.danigunawan.com/just-for-fun/flying-skull-head/</link>
		<comments>http://blog.danigunawan.com/just-for-fun/flying-skull-head/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 03:25:00 +0000</pubDate>
		<dc:creator>Dagu</dc:creator>
				<category><![CDATA[Just For Fun]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://blog.danigunawan.com/2007/11/10/kepala-tengkorak-terbang/</guid>
		<description><![CDATA[Tired of your work? Or still downloading files? Maybe you should try this funny script while waiting something. Believe me, it&#8217;s not dangerous.

Open http://images.google.com. Type &#8220;skull head&#8221; or whatever words you like.


Google Search

Press enter and then skull images will appear.
Delete URL in address bar and copy paste script below to address bar.
javascript:R=0; x1=.1; y1=.05; x2=.25; [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Tired of your work? Or still downloading files? Maybe you should try this funny script while waiting something. Believe me, it&#8217;s not dangerous.</p>
<ol>
<li>Open <a href="http://images.google.com/">http://images.google.com</a>. Type &#8220;<span style="font-weight: bold;">skull head</span>&#8221; or whatever words you like.</li>
<dl id="attachment_235" class="wp-caption aligncenter" style="width: 410px;">
<dt class="wp-caption-dt"><a href="http://blog.danigunawan.com/wp-content/uploads/2008/11/search.jpg"><img class="size-full wp-image-235" title="Google Search" src="http://blog.danigunawan.com/wp-content/uploads/2008/11/search.jpg" alt="Google Search" width="400" height="150" /></a></dt>
<dd class="wp-caption-dd">Google Search</dd>
</dl>
<li>Press enter and then skull images will appear.</li>
<div id="attachment_237" class="wp-caption aligncenter" style="width: 410px"><a href="http://blog.danigunawan.com/wp-content/uploads/2008/11/hasil.jpg"><img class="size-full wp-image-237" title="Hasil Pencarian" src="http://blog.danigunawan.com/wp-content/uploads/2008/11/hasil.jpg" alt="Hasil Pencarian Gambar Tengkorak" width="400" height="222" /></a><p class="wp-caption-text">Search result from keyword &quot;skull head&quot;</p></div>
<li>Delete URL in address bar and copy paste script below to address bar.</li>
<blockquote><p><span style="font-weight: bold;">javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24;  x4=300; y4=200; x5=300; y5=200; DI= document.images; DIL=DI.length;  function A(){for(i=0; i&lt;DIL; i++){DIS=DI[ i ].style;  DIS.position=&#8217;absolute&#8217;; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5;  DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}<br />
setInterval(&#8216;A()&#8217;,5 ); void(0)</span></p></blockquote>
<div id="attachment_240" class="wp-caption aligncenter" style="width: 410px"><a href="http://blog.danigunawan.com/wp-content/uploads/2008/11/address.jpg"><img class="size-full wp-image-240" title="Copas Script ke Address Bar" src="http://blog.danigunawan.com/wp-content/uploads/2008/11/address.jpg" alt="Copas Script ke Address Bar" width="400" height="20" /></a><p class="wp-caption-text">Copy paste script above to address bar</p></div>
<li>Press enter and see what will happen&#8230;</li>
<p><div id="attachment_238" class="wp-caption aligncenter" style="width: 410px"><a href="http://blog.danigunawan.com/wp-content/uploads/2008/11/gbr_terbang.jpg"><img class="size-full wp-image-238" title="Gambar Tengkorak Terbang" src="http://blog.danigunawan.com/wp-content/uploads/2008/11/gbr_terbang.jpg" alt="Gambar Tengkorak Terbang" width="400" height="228" /></a><p class="wp-caption-text">Flying skull head</p></div></ol>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.danigunawan.com/just-for-fun/flying-skull-head/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
