<?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>website55 &#187; PHP/mySQL</title>
	<atom:link href="http://www.website55.com/category/php-mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.website55.com</link>
	<description>easy guide to build, optimize and secure your web site</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:26:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>PHP Anthem</title>
		<link>http://www.website55.com/php-mysql/2010/08/php-anthem.html</link>
		<comments>http://www.website55.com/php-mysql/2010/08/php-anthem.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 13:08:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[PHP/mySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php anthem]]></category>

		<guid isPermaLink="false">http://www.website55.com/?p=263</guid>
		<description><![CDATA[PHP finally has an anthem. Download the song (MP3) Download [...]]]></description>
			<content:encoded><![CDATA[<p>PHP finally has an anthem.</p>
<ul>
<li><a target="_blank" href="http://drop.io/6obkw8b">Download the song (MP3)</a></li>
<li><a target="_blank" href="http://fracturedvisionmedia.com/FVM005/downloads/FVM005_MP3.zip">Download the entire album (MP3)</a></li>
<li><a target="_blank" href="http://fracturedvisionmedia.com/FVM005/downloads/FVM005_CDR.zip">Download the entire album (CD)</a></li>
<li><a target="_blank" href="http://youtube.com/watch?v=S8zhmiS-1kw">Watch on YouTube</a></li>
</ul>
<p>via <a href="http://shiflett.org/blog/2010/aug/php-anthem" target="_blank">Chris Shiflett</a></p>
<blockquote style="font-size:12px"><p>
<b>Lyrics</b></p>
<p>Oh yeah. (Oh yeah.)<br />
(Just one day it just hits you all of a sudden. It&#8217;s just like&#8230;)</p>
<p>Oh yeah, I&#8217;m so <a href="http://php.net/">PHP</a> this year.<br />
Got a <a href="http://piqueweb.net/">mic</a> in the <a href="http://php.net/ltrim">left</a>, and &#8216;n the <a href="http://php.net/rtrim">right</a>, <a href="http://seancoates.com/brews">cold beer</a>.<br />
Compile that <a href="http://httpd.apache.org/">Apache</a>.<br />
Now we got <a href="http://php.net/downloads.php#v5">version 5</a> and <a href="http://flickr.com/photos/hasta-pronto/373225236/">two chicks</a> laid out in the back seat.<br />
Yeah, sometimes the <a href="http://forums.devnetwork.net/viewtopic.php?t=53286">code looks a little trashy</a>.<br />
But, this ain&#8217;t <a href="http://en.wikipedia.org/wiki/ColdFusion">ColdFusion</a>.<br />
Stop talking <a href="http://sass-lang.com/">sassy</a>, and pull up them <a href="http://cafepress.com/+php+underwear-panties">panties</a>.</p>
<p>I&#8217;m really&#8230; I&#8217;m just saying; why don&#8217;t you go check out the <a href="http://php.net/docs.php">API reference docs</a>.<br />
They&#8217;re really good.<br />
(They are.)</p>
<p>Is it <a href="http://php.net/date_time_set">underline</a> or <a href="http://php.net/datetime.settime">CamelCase</a>?<br />
I can&#8217;t <a href="http://php.net/apc_store">remember</a>; I&#8217;ve been busy <a href="http://lithify.me/">poundin&#8217; cakes</a>.<br />
It&#8217;s what <a href="http://phpdeveloper.org/">PHP developers</a> do.<br />
We <a href="http://php.net/usage.php">get more booty</a> than you.<br />
Don&#8217;t be jealous when you smell us; <a href="http://php.net/if">check</a> the <a href="http://php.net/bool">Boolean</a> dude, it reads&#8230;</p>
<p>[<a href="http://php.net/closures">chorus</a>]<br />
(Oh yeah.)<br />
Check the Boolean dude; it reads true.<br />
(Oh yeah.)<br />
PHP gets more booty than you.<br />
(Oh yeah.)<br />
Check the Boolean dude; it reads true.<br />
(Oh yeah.)<br />
PHP gets more booty than you.<br />
(Oh yeah.)<br />
Check the Boolean dude; it reads&#8230;</p>
<p>True, PHP gets more booty than you,<br />
but we still keep it <a href="http://shiflett.org/articles/sql-injection">clean</a>.<br />
<a href="http://mysql.org/" class="broken_link">MySQL</a> <a href="http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string">really real</a> wrappin&#8217; all <a href="http://php.net/string">strings</a>.<br />
<a href="http://shiflett.org/blog/2005/feb/my-top-two-php-security-practices">Filter input</a> like it was a herpes strain.<br />
(You know what I&#8217;m saying?)<br />
That&#8217;s why we got the <a href="http://php.net/reserved.classes">STD class</a>.<br />
<a href="http://php.net/oop5">Objects</a> we <a href="http://php.net/references.pass">pass</a> might need to be <a href="http://php.net/gc">trashed</a>.<br />
Girl, what you doin&#8217;?</p>
<p>Come <a href="http://en.wikipedia.org/wiki/Gunzip">gunzip</a> this.<br />
Be my witness as I <a href="http://php.net/stripslashes">strip this string of all slashes.</a><br />
Now, I got what I need.<br />
No <a href="http://phpsecurity.org/contents#ch06">traversing my filesystem</a> when you ain&#8217;t supposed to be.<br />
That&#8217;s how it is <a href="http://nexdot.net/blog/2008/09/15/ruby-on-fails-story-and-stickers/" class="broken_link">rolling with PHP</a>.<br />
All the <a href="http://phpwomen.org/">hot chicks</a>, yeah, they love PHP.<br />
(It&#8217;s so true.)<br />
(Oh yeah, that&#8217;s what I&#8217;m talking about.)</p>
<p>[chorus]</p>
<p>(Yo, yo, <a href="http://php.net/ftell">tell</a> &#8216;em about it.)</p>
<p><a href="http://php.net/history">PHP: Hypertext Preprocessor</a>.<br />
It&#8217;s <a href="http://php.net/is_real">real</a> out here.<br />
Somebody better <a href="http://php.net/call_user_func">call</a> the <a href="http://modsecurity.org/">mod_security</a> <a href="http://ivanristic.com/">officer</a>.<br />
My concern is for those <a href="http://terrychay.com/article/is-ruby-the-dog-and-php-the-dogfood.shtml">weak half-assed scripting languages</a>.<br />
The ones that can&#8217;t hang with us.<br />
It&#8217;s strange, but they <a href="http://packetstormsecurity.org/0910-advisories/dsa-1905-1.txt">get hanged</a> and <a href="http://tiobe.com/index.php/content/paperinfo/tpci/">remain in dust</a>.<br />
Some <a href="http://shiflett.org/blog/2008/aug/end-of-life-for-php-4">aren&#8217;t quite dead</a> and still remain a <a href="http://java.sun.com/developer/technicalArticles/xml/webservices/">pain to us</a>.</p>
<p>PHP&#8217;s got more muscle.<br />
<a href="http://oreilly.com/catalog/9780596100674">In a nutshell</a>, nothing&#8217;s quite <a href="http://php.net/language.operators.comparison">like</a> it.</p>
<p>Predicted by the <a href="http://toys.lerdorf.com/">ancient cultures</a> and the <a href="http://zend.com/">psychics</a>.<br />
The ones who dreamt in <a href="http://php.net/class.recursiveiteratoriterator">recursive</a> states.<br />
<a href="http://php.net/language.operators.errorcontrol">Whispering</a> premonitions of <a href="http://php.net/license/">open source</a> <a href="http://schlueters.de/">community gates</a>.<br />
PHP.</p>
<p>(Oh yeah&#8230;)</p>
<p>[chorus]</p>
</blockquote>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.website55.com/php-mysql/2010/08/php-anthem.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to calculate strings with PHP</title>
		<link>http://www.website55.com/php-mysql/2010/04/how-to-calculate-strings-with-php.html</link>
		<comments>http://www.website55.com/php-mysql/2010/04/how-to-calculate-strings-with-php.html#comments</comments>
		<pubDate>Tue, 27 Apr 2010 12:18:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[PHP/mySQL]]></category>
		<category><![CDATA[calculate strings]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.website55.com/?p=232</guid>
		<description><![CDATA[Ever wondering to calculate 2 + 2 ? Sure you [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wondering to calculate 2 + 2 ? Sure you have.<br />
But what if your formula comes in a string input ?<br />
So, how to calculate &#8220;2 + 2&#8243; or &#8220;4 * ( 3 &#8211; 5 )&#8221; in PHP ?</p>
<p>We&#8217;ll have the function <em><strong>calculate_string($mathstring)</strong></em>.</p>
<pre class="brush: php; title: ; notranslate">

function calculate_string( $mathString )	{
	$mathString = trim($mathString);     // trim white spaces
	$mathString = ereg_replace ('[^0-9\+-\*\/\(\) ]', '', $mathString);    // remove any non-numbers chars; exception for math operators

	$compute = create_function(&quot;&quot;, &quot;return (&quot; . $mathString . &quot;);&quot; );
	return 0 + $compute();
}

$string = &quot; (1 + 1) * (2 + 2)&quot;;
echo calculate_string($string);  // outputs 8  
</pre>


<p>Related posts:<ol><li><a href='http://www.website55.com/php-mysql/2009/12/php-interview-questions-1.html' rel='bookmark' title='PHP Interview Questions I'>PHP Interview Questions I</a></li>
<li><a href='http://www.website55.com/php-mysql/2010/08/php-anthem.html' rel='bookmark' title='PHP Anthem'>PHP Anthem</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.website55.com/php-mysql/2010/04/how-to-calculate-strings-with-php.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>PHP Interview Questions I</title>
		<link>http://www.website55.com/php-mysql/2009/12/php-interview-questions-1.html</link>
		<comments>http://www.website55.com/php-mysql/2009/12/php-interview-questions-1.html#comments</comments>
		<pubDate>Tue, 15 Dec 2009 21:28:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP/mySQL]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://website55.com/?p=81</guid>
		<description><![CDATA[<h3 class="q"><strong>1.</strong> What does <strong>&#60;?= and ?&#62;</strong> do in PHP?</h3>

<h3 class="q"><strong>2. What are the diferent type of errors in <strong>PHP</strong>?</strong></h3>

<h3 class="q"><strong>3. What are the differences between <em>require</em> / <em>include</em>, <em>require_once</em> / <em>include_once</em>?</strong></h3>

<h3 class="q"><strong>4. What is meant by <em>urlencode</em> and <em>urldecode</em>?</strong></h3>

<h3 class="q"><b>5. What’s the difference between <em>htmlentities()</em> and <em>htmlspecialchars()</em>?</b></h3>


<h3 class="q"><b>6. What’s the difference between <em>PHP4</em> and <em>PHP5</em>?</b></h3>



<h3 class="q"><b>7. What’s the difference between <em>PHP5</em> and <em>PHP6</em>?</b></h3>


]]></description>
			<content:encoded><![CDATA[<h3 id="q1" class="quest"><strong>1.</strong>What does <strong>&lt;?= and ?&gt;</strong> do in PHP?</h3>
<ul>
<li><strong style="color:#444">Answer</strong>
<p>The output is displayed directly to the browser.</p>
<pre class="brush: php; title: ; notranslate"> &lt;?=&quot;website&quot;.55?&gt;  // outputs website55 </pre>
<p><img style="float:left" src="/wp-includes/images/icon_caution.png" alt="TIP" width="24" /><strong>TIP:</strong> <em>If you&#8217;re using short tags, be sure the <em><strong>&#8220;short_open_tag = on&#8221;</strong></em> is enabled in your <span style="font-family:monospace;">php.ini</span></em></p>
<p><img style="float:left" src="/wp-includes/images/icon_note.png" alt="NOTE" width="24" /><strong>NOTE:</strong> <em>Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags.</em></li>
</ul>
<h3 id="q2" class="quest"><strong>2. What are the diferent type of errors in <strong>PHP</strong>?<br />
</strong></h3>
<ul>
<li><strong style="color:#444">Answer</strong>
<p>There are three basic types of runtime errors in PHP:</p>
<p><strong>1. Notices</strong>: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although you can change this default behavior.</p>
<p><img style="float:left" src="/wp-includes/images/icon_note.png" alt="NOTE" width="24" /><em>Execution of the script is not terminated, but it is possible there is an error in your code. </em></p>
<p><strong>2. Warnings</strong>: These are more serious errors – for example, attempting to include() a file which does not exist.</p>
<p><img style="float:left" src="/wp-includes/images/icon_caution.png" alt="TIP" width="24" /> <em>By default, these errors are displayed to the user, but they do not result in script termination.</em></p>
<p><strong>3. Fatal errors</strong>: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. Internally, these variations are represented by twelve different error types.</p>
<p><img style="float:left" src="/wp-includes/images/icon_important.png" alt="TIP" width="18" /><em>These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.</em></p>
<p><a href="http://www.tuxradar.com/practicalphp/19/12/1" target="_blank">Here </a> is the complete list for all types of errors in PHP.</li>
</ul>
<h3 id="q3" class="quest"><strong>3. What are the differences between <em>require</em> / <em>include</em>, <em>require_once</em> / <em>include_once</em>?<br />
</strong></h3>
<ul>
<li><strong style="color:#444">Answer 1</strong>
<p>require_once() and include_once() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.But require() and include() will do it as many times they are asked to do.
</li>
<li><strong style="color:#444">Answer 2</strong>
<p>The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. The major difference between include() and require() is that in failure include() produces a warning message whereas require() produces a fatal errors.</p>
</li>
<li><strong style="color:#444">Answer 3</strong>
<p>All three are used to an include file into the current page.<br />
If the file is not present, require(), calls a fatal error, while in include() does not.<br />
The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. It des not call a fatal error if file not exists. require_once() does the same as include_once(), but it calls a fatal error if file not exists.</p>
</li>
<li><strong style="color:#444">Answer 4</strong>
<p>File will not be included more than once. If we want to include a file once only and further calling of the file will be ignored then we have to use the PHP function include_once(). This will prevent problems with function redefinitions, variable value reassignments, etc.</p>
<p><img style="float:left" src="/wp-includes/images/icon_note.png" alt="NOTICE" width="18" /><strong>NOTE</strong>:<em> For faster execution, try to use <a rel="nofollow" href="http://www.php.net/manual/en/function.require-once.php#90017">absolute path</a> when calling these functions.</em>
</li>
</ul>
<h3 id="q4" class="quest"><strong>4. What is meant by <a target="_blank" rel="nofollow" href="http://php.net/manual/en/function.urlencode.php"><em>urlencode</em></a> and <a target="_blank" href="http://www.php.net/manual/en/function.urldecode.php" rel="nofollow"><em>urldecode</em>?</strong></a></h3>
<ul>
<li><strong style="color:#444">Answer 1</strong>
<p><strong>urlencode()</strong> returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. </p>
<p><em>For example</em>: <strong><em>urlencode(&#8220;10.00%&#8221;)</em></strong> will return <em>&#8220;10%2E00%25&#8243;.</em> URL encoded strings are safe to be used as part of URLs.</p>
<p><strong>urldecode()</strong> returns the URL decoded version of the given string
</li>
<li><strong style="color:#444">Answer 2</strong>
<p>string <strong><em>urlencode(str)</em></strong> &#8211; Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encoded version:</p>
<p>Alphanumeric characters are maintained as is.<br />
Space characters are converted to &#8220;+&#8221; characters.<br />
Other non-alphanumeric characters are converted &#8220;%&#8221; followed by two hex digits representing the converted character.</p>
<p>string <strong><em>urldecode(str)</em></strong> &#8211; Returns the original string of the input URL encoded string.</p>
<p>For example:</p>
<pre class="brush: php; title: ; notranslate">
$procent =&quot;10.00%&quot;;
$url = &quot;http://example.org/exec.php?procent=&quot;.urlencode($procent);
echo $url;
</pre>
<p>You will get <em>&#8220;http://example.com/exec.php?procent=10%2E00%25&#8243;. </em>
</li>
</ul>
<h3 id="q5" class="quest"><b>5. What’s the difference between <a target="_blank" rel="nofollow" href="http://us2.php.net/manual/en/function.htmlentities.php"><em>htmlentities()</em></a> and <a target="_blank" href="http://us2.php.net/manual/en/function.htmlspecialchars.php" rel="nofollow"><em>htmlspecialchars()</em></a>?</b></h3>
<ul>
<li><strong style="color:#444">Answer</strong>
<p><em><strong>htmlspecialchars</strong></em> only takes care of <, >, single quote &#8216;, double quote &#8221; and ampersand. <strong><em>htmlentities</em> </strong> translates all occurrences of character sequences that have different meaning in HTML.
</li>
</ul>
<h3 id="q6" class="quest"><b>6. What’s the difference between <em>PHP4</em> and <em>PHP5</em>?</b></h3>
<ul>
<li><strong style="color:#444">Answer</strong>
<p>There are several differences between PHP4 and PHP5.<br />
1. Unified Constructor and Destructor.<br />
2. Exception has been introduced.<br />
3. New error level named E_STRICT has been introduced.<br />
4. Now we can define full method definintions for a abstract class.<br />
5. Within a class we can define class constants.<br />
6. Public, private and proted method introduced</p>
<p>A great article you may read <a target="_blank" rel="nofollow" href="http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html">here</a>.</p>
</li>
</ul>
<h3 id="q7" class="quest"><b>7. What’s the difference between <em>PHP5</em> and <em>PHP6</em>?</b></h3>
<ul>
<li><strong style="color:#444">Answer</strong>
<p>1. The operators <em>continue </em>and <em>break </em>will work with a constant parameter or without parameter.<br />
2. The <a rel="nofollo" target="_blank" href="http://www.php.net/manual/en/function.ereg.php"><em>ereg()</em></a> function for regular expressions <em>will be deleted</em>. It will be replaced by <a rel="nofollo" target="_blank" href="http://php.net/manual/en/function.preg-match.php"><em>preg_match()</em></a> whose format is different but more generally used.<br />
3. The compatibility with older formats like GD 1 and Freetype 1 <em>will no longer be supported.</em><br />
4. Magic_quotes, that was very decried as a source of security holes <em>will no longer be supported.</em><br />
5. The same is true for register_global, safe_mode and register_long_arrays.</p>
</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.website55.com/php-mysql/2010/04/how-to-calculate-strings-with-php.html' rel='bookmark' title='How to calculate strings with PHP'>How to calculate strings with PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.website55.com/php-mysql/2009/12/php-interview-questions-1.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

