<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Kavoir</title>
	
	<link>http://www.kavoir.com</link>
	<description>Just another dumbass webmaster, goofing around...</description>
	<lastBuildDate>Sat, 12 May 2012 04:58:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Kavoir" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kavoir" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">Kavoir</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Customize WordPress Login Header and Link, Upgrade-proof without Plugin</title>
		<link>http://www.kavoir.com/2012/05/customize-wordpress-login-header-and-link-upgrade-proof-without-plugin.html</link>
		<comments>http://www.kavoir.com/2012/05/customize-wordpress-login-header-and-link-upgrade-proof-without-plugin.html#comments</comments>
		<pubDate>Sat, 12 May 2012 04:57:19 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[WordPress How To]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2881</guid>
		<description><![CDATA[The default image header and link on the login / register page of WordPress is a WordPress one, apparently, but when you are enabling registration / login to general users, you would want to use your own logo and website URL as the header rather than the default -&#160; so people don’t get confused and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The default image header and link on the login / register page of WordPress is a WordPress one, apparently, but when you are enabling registration / login to general users, you would want to use your own logo and website URL as the header rather than the default -&#160; so people don’t get confused and freak out!</p>

<p>It’s amazing how WordPress has made such simple customizations even simpler by the introduction of hooks. Just insert the following snippet in your theme’s <strong>functions.php</strong>:</p>
<pre><code>add_action('<strong>login_head</strong>', 'my_custom_login_logo');
function my_custom_login_logo() {
    echo '&lt;style type=&quot;text/css&quot;&gt;
        h1 a { background-image:url('.dirname(get_bloginfo('stylesheet_url')).'/my_custom_login_logo.png) !important; }
    &lt;/style&gt;';
}

add_filter('<strong>login_headerurl</strong>', 'my_custom_login_link');
function my_custom_login_logo(){
    return ('/'); // put here your website URL such as http://www.example.com/ or simply /
}</code></pre>
<p>Just provide your own logo and upload it to your theme directory as <strong>my_custom_login_logo.png</strong>. You can also use <strong>get_bloginfo(&#8216;template_directory&#8217;)</strong> for theme path but that would return the parent theme path if you have a child theme. Sensibly, we would put all customizations in the child theme, so <strong>dirname(get_bloginfo(&#8216;stylesheet_url&#8217;))</strong> is probably a better approach.</p>
<p>Without editing the core files, this solution is upgrade-proof and you don&#8217;t have to install any plugin. </p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/02/php-why-you-should-use-dirname__file__-include-php-instead-of-just-include-php.html" rel="bookmark" title="February 9, 2010">PHP: Why you should use dirname(__FILE__).&lsquo;/include.php&rsquo; instead of just &lsquo;include.php&rsquo;</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-damn-premium-wordpress-theme-for-professional-bloggers-thesis.html" rel="bookmark" title="June 15, 2009">Best Damn Premium WordPress Theme for Professional Blogs: THESIS</a></li>
<li><a href="http://www.kavoir.com/2012/01/customize-wordpress-post-editor-css-styles.html" rel="bookmark" title="January 19, 2012">Customize WordPress Post Editor CSS Styles</a></li>
<li><a href="http://www.kavoir.com/2011/12/cheap-psd-to-wordpress-theme-and-custom-plugins.html" rel="bookmark" title="December 23, 2011">Cheap PSD to WordPress Theme and Custom Plugins</a></li>
<li><a href="http://www.kavoir.com/2011/12/redirect-404-error-to-home-page.html" rel="bookmark" title="December 25, 2011">Redirect 404 Error to Home Page</a></li>
</ul>
<p><!-- Similar Posts took 2.377 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/05/customize-wordpress-login-header-and-link-upgrade-proof-without-plugin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Firefox Spell Checker for Single-line Text Input</title>
		<link>http://www.kavoir.com/2012/05/enable-firefox-spell-checker-for-single-line-text-input.html</link>
		<comments>http://www.kavoir.com/2012/05/enable-firefox-spell-checker-for-single-line-text-input.html#comments</comments>
		<pubDate>Sat, 12 May 2012 03:26:41 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Computer & Internet Literacy]]></category>
		<category><![CDATA[Internet Tools]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2879</guid>
		<description><![CDATA[Firefox has come with a tremendously useful feature that is the spell checking. However the problem is, by default, it only checks the spelling of text in &#60;textarea&#62;&#60;/textarea&#62; the block text input. How to make it also check the spelling of &#60;input type=”text” /&#62; so that we can be worry-free of misspelled words in single-line [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Firefox has come with a tremendously useful feature that is the spell checking. However the problem is, by default, it only checks the spelling of text in <strong>&lt;textarea&gt;&lt;/textarea&gt;</strong> the block text input. How to make it also check the spelling of <strong>&lt;input type=”text” /&gt;</strong> so that we can be worry-free of misspelled words in single-line input text boxes as well such as when you are entering article titles, product names, etc.?</p>

<p>There is a very simple way to do this. Just fire up your Firefox, type in the address bar and enter:</p>
<pre>about:config</pre>
<p>And then filter by:</p>
<pre>layout.spellcheckDefault</pre>
<p>So that you would see a configuration line like this:</p>
<p><img class="frame" title="firefox spell checker settings" border="0" alt="firefox spell checker settings" src="http://www.kavoir.com/wp-content/uploads/2012/05/firefox-spell-check.png" width="527" height="79" /></p>
<p>Double click on the Value and change it from 1 to <strong>2</strong>. That’s it.</p>
<p>You don’t even have to restart Firefox and it will start inspecting all single-line input text boxes for wrong spellings from now on.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/08/how-to-change-the-browser-window-status-bar-text-of-firefox-with-javascript.html" rel="bookmark" title="August 22, 2009">How to change the browser window status bar text of Firefox with JavaScript?</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-read-from-keyboard-get-user-input-from-keyboard-console-by-typing.html" rel="bookmark" title="April 22, 2009">PHP: Read from Keyboard &#8211; Get User Input from Keyboard Console by Typing</a></li>
<li><a href="http://www.kavoir.com/2010/03/php-check-or-validate-url-and-email-addresses-an-easier-way-than-regular-expressions-the-filter_var-function.html" rel="bookmark" title="March 4, 2010">PHP: Check or Validate URL and Email Addresses &ndash; an Easier Way than Regular Expressions, the filter_var() Function</a></li>
<li><a href="http://www.kavoir.com/2009/08/css-how-to-align-html-input-checkbox-and-radio-with-text-in-the-same-line.html" rel="bookmark" title="August 29, 2009">CSS: How to align HTML input checkbox and radio with text on the same line?</a></li>
<li><a href="http://www.kavoir.com/2008/12/backup-and-recover-a-mysql-database-under-command-line.html" rel="bookmark" title="December 14, 2008">Backup and recover a MySQL database under command line</a></li>
</ul>
<p><!-- Similar Posts took 2.429 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/05/enable-firefox-spell-checker-for-single-line-text-input.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot use ctrl-c. How to stop tail -f, etc?</title>
		<link>http://www.kavoir.com/2012/05/cannot-use-ctrl-c-how-to-stop-tail-f-etc.html</link>
		<comments>http://www.kavoir.com/2012/05/cannot-use-ctrl-c-how-to-stop-tail-f-etc.html#comments</comments>
		<pubDate>Mon, 07 May 2012 07:56:15 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Linux Server Administration Tips]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2876</guid>
		<description><![CDATA[When I ssh into my Debian Squeeze server and start up tail -f to watch a log file or anything else which uses ctrl-c to exit/stop, ctrl-c does not work. It prints the ^C character on screen and just keeps right on going. Is there a setting somewhere that can be tweaked or maybe a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When I ssh into my Debian Squeeze server and start up tail -f to watch a log file or anything else which uses ctrl-c to exit/stop, ctrl-c does not work. It prints the ^C character on screen and just keeps right on going.</p>

<p>Is there a setting somewhere that can be tweaked or maybe a different key combo that needs pressed?</p>
<p>Search results suggest that it&#8217;s a pretty common problem to Debian and that tinkering with the getty settings in /etc/inittab can fix it, but I&#8217;m hesitant to mess around in there too much. I may just take a snapshot and then see what happens.</p>
<p>Definitely an inittab thing, in case anyone else runs into this.    <br />This line used to be at the top of the getty stuff</p>
<p><b>Code:</b></p>
<pre>8:2345:respawn:/sbin/getty 38400 hvc0</pre>
<p>I just moved it to the bottom and now ctrl-c works when connected using ssh.</p>
<p><b>Code:</b></p>
<pre> 1:2345:respawn:/sbin/getty 38400 tty1
 2:23:respawn:/sbin/getty 38400 tty2
 3:23:respawn:/sbin/getty 38400 tty3
 4:23:respawn:/sbin/getty 38400 tty4
 5:23:respawn:/sbin/getty 38400 tty5
 6:23:respawn:/sbin/getty 38400 tty6
 8:2345:respawn:/sbin/getty 38400 hvc0</pre>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/05/accidental-ctrls-locks-and-freezes-linux-terminal-ssh-telnet.html" rel="bookmark" title="May 26, 2009">Accidental Ctrl+S Locks and Freezes Linux Terminal / SSH / Telnet</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-bring-down-optimize-memory-usage-in-your-unmanaged-linux-vps-box-and-avoid-oom-out-of-memory-errors.html" rel="bookmark" title="July 1, 2010">How to bring down / optimize memory usage in your unmanaged Linux VPS box and avoid OOM (Out Of Memory) errors?</a></li>
<li><a href="http://www.kavoir.com/2010/07/how-to-execute-php-scripts-in-the-background.html" rel="bookmark" title="July 18, 2010">How to execute / run PHP scripts in the background?</a></li>
<li><a href="http://www.kavoir.com/2009/08/whats-the-new-line-or-carriage-return-in-a-mysql-query.html" rel="bookmark" title="August 3, 2009">What are New Line Feed and Carriage Return in a MySQL query?</a></li>
<li><a href="http://www.kavoir.com/2009/10/hawkhost-promo-code-for-50-off.html" rel="bookmark" title="October 1, 2009">Hawkhost promo code for 50% off</a></li>
</ul>
<p><!-- Similar Posts took 2.688 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/05/cannot-use-ctrl-c-how-to-stop-tail-f-etc.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Class for Handling .htpasswd and .htgroup (Member Login &amp; User Management)</title>
		<link>http://www.kavoir.com/2012/04/php-class-for-handling-htpasswd-and-htgroup-member-login-user-management.html</link>
		<comments>http://www.kavoir.com/2012/04/php-class-for-handling-htpasswd-and-htgroup-member-login-user-management.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 02:58:38 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[.htaccess Tutorials & Tips]]></category>
		<category><![CDATA[Free PHP Classes & Library]]></category>
		<category><![CDATA[Information Security]]></category>
		<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2872</guid>
		<description><![CDATA[Apache is a marvelous web server that offers .htpasswd and .htgroup for controlling restricted access to your website. By help of .htaccess, they work as a member login &#38; user management system that is so simple and easy to deploy. You can even define user groups / roles with it. Basically, .htpasswd defines pairs of [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Apache is a marvelous web server that offers <strong>.htpasswd</strong> and <strong>.htgroup</strong> for controlling restricted access to your website. By help of <strong>.htaccess</strong>, they work as a member login &amp; user management system that is so simple and easy to deploy. You can even define user groups / roles with it.</p>

<p>Basically,</p>
<ul>
<li><strong>.htpasswd</strong> defines pairs of <strong>username</strong> &amp; <strong>password</strong> that are user accounts. </li>
<li><strong>.htgroup</strong> defines groups / roles of user accounts that can be access-controlled as a whole. </li>
<li><strong>.htaccess</strong> then applies <strong>.htpasswd</strong> and <strong>.htgroup</strong> to the current directory, and specifies which <em>groups</em> in <strong>.htgroup</strong> has access to the current directory. </li>
</ul>
<p>For example, we have</p>
<h4>/home/myuser/.htpasswd</h4>
<pre><code>user1:{SHA}kGPaD671VNU0OU5lqLiN/h6Q6ac=
user2:{SHA}npMqPEX3kPQTo+x/+ZckHDrIcQI=
user3:{SHA}q1Fh2LTUjjkncp11m0M9WUH5Zrw=</code></pre>
<h4>/home/myuser/.htgroup</h4>
<pre><code>admin: user2
editor: user1 user3
writer: user3</code></pre>
<h4>/home/myuser/public_html/example.com/member/.htaccess</h4>
<pre><code>AuthName &quot;Members Area&quot;
AuthType Basic
AuthUserFile <strong>/home/myuser/.htpasswd</strong>
AuthGroupFile <strong>/home/myuser/.htgroup</strong>
&lt;Limit GET POST&gt;
require group <strong>admin</strong>
require group <strong>writer</strong>
&lt;/Limit&gt;</code></pre>
<p>What they do is only let users in the <strong>admin</strong> and <strong>writer</strong> group, that is <strong>user2</strong> and <strong>user3</strong>, to access <em>example.com/member</em>. When someone tries to access <em>example.com/member</em>, Apache would prompt him or her for user name and password, and he or she must be either user2 or user3 to access it – they must enter the correct password set out in .htpasswd for user2 or user3. </p>
<p><strong>user1</strong> isn’t allowed to access example.com/member even if the password is correct. You get the idea.</p>
<p>You can place <strong>.htaccess</strong> anywhere in your website, and it will control access to the directory it’s in by the defined rules (which groups / roles are allowed to access). Just make sure it is pointing to the right .htpasswd and .htgroup by <strong>AuthUserFile</strong> and <strong>AuthGroupFile</strong>.</p>
<p>And you can have <strong>multiple .htaccess</strong> in different directories of your website, using the same .htpasswd and .htgroup.</p>
<p>This is so simple yet so very handy in creating &amp; managing different users and user roles (.htpasswd, .htgroup) and giving them permissions (.htaccess) in accessing different website assets.</p>
<h2>PHP Class</h2>
<p>Now that you are familiar with the basic authentication and native user management system in Apache, you can use this two simple PHP classes to automate tasks such as user creation, user deletion, adding user to group, and removing user from group.</p>
<h4>class Htpasswd</h4>
<pre><code>class Htpasswd {

	private $file = '';
	private $salt = 'AynlJ2H.74VEfI^BZElc-Vb6G0ezE9a55-Wj';

	private function write($pairs = array()) {
		$str = '';
		foreach ($pairs as $username =&gt; $password) {
			$str .= &quot;$username:{SHA}$password\n&quot;;
		}
		file_put_contents($this -&gt; file, $str);
	}

	private function read() {
		$pairs = array();
		$fh = fopen($this -&gt; file, 'r');
		while (!feof($fh)) {
			$pair_str = str_replace(&quot;\n&quot;, '', fgets($fh));
			$pair_array = explode(':{SHA}', $pair_str);
			if (count($pair_array) == 2) {
				$pairs[$pair_array[0]] = $pair_array[1];
			}
		}
		return $pairs;
	}

	private function getHash($clear_password = '') {
		if (!empty($clear_password)) {
			return base64_encode(sha1($clear_password, true));
		} else {
			return false;
		}
	}

	public function __construct($file) {
		if (file_exists($file)) {
			$this -&gt; file = $file;
		} else {
			die($file.&quot; doesn't exist.&quot;);
			return false;
		}
	}

	public function <strong>addUser</strong>($username = '', $clear_password = '') {
		if (!empty($username) &amp;&amp; !empty($clear_password)) {
			$all = $this -&gt; read();
			if (!array_key_exists($username, $all)) {
				$all[$username] = $this -&gt; getHash($clear_password);
				$this -&gt; write($all);
			}
		} else {
			return false;
		}
	}

	public function <strong>deleteUser</strong>($username = '') {
		$all = $this -&gt; read();
		if (array_key_exists($username, $all)) {
			unset($all[$username]);
			$this -&gt; write($all);
		} else {
			return false;
		}
	}

	public function <strong>doesUserExist</strong>($username = '') {
		$all = $this -&gt; read();
		if (array_key_exists($username, $all)) {
			return true;
		} else {
			return false;
		}
	}

	public function <strong>getClearPassword</strong>($username) {
		return strtolower(substr(sha1($username.$this -&gt; salt), 4, 12));
	}

}</code></pre>
<h4>class Htgroup</h4>
<pre><code>class Htgroup {

	private $file = '';

	private function write($groups = array()) {
		$str = '';
		foreach ($groups as $group =&gt; $users) {
			$users_str = '';
			foreach ($users as $user) {
				if (!empty($users_str)) {
					$users_str .= ' ';
				}
				$users_str .= $user;
			}
			$str .= &quot;$group: $users_str\n&quot;;
		}
		file_put_contents($this -&gt; file, $str);
	}

	private function read() {
		$groups = array();
		$groups_str = file($this -&gt; file, FILE_IGNORE_NEW_LINES);
		foreach ($groups_str as $group_str) {
			if (!empty($group_str)) {
				$group_str_array = explode(': ', $group_str);
				if (count($group_str_array) == 2) {
					$users_array = explode(' ', $group_str_array[1]);
					$groups[$group_str_array[0]] = $users_array;
				}
			}
		}
		return $groups;
	}

	public function __construct($file) {
		if (file_exists($file)) {
			$this -&gt; file = $file;
		} else {
			die($file.&quot; doesn't exist.&quot;);
			return false;
		}
	}

	public function <strong>addUserToGroup</strong>($username = '', $group = '') {
		if (!empty($username) &amp;&amp; !empty($group)) {
			$all = $this -&gt; read();
			if (isset($all[$group])) {
				if (!in_array($username, $all[$group])) {
					$all[$group][] = $username;
				}
			} else {
				$all[$group][] = $username;
			}
			$this -&gt; write($all);
		} else {
			return false;
		}
	}

	public function <strong>deleteUserFromGroup</strong>($username = '', $group = '') {
		$all = $this -&gt; read();
		if (array_key_exists($group, $all)) {
			$user_index = array_search($username, $all[$group]);
			if ($user_index !== false) {
				unset($all[$group][$user_index]);
				if (count($all[$group]) == 0) {
					unset($all[$group]);
				}
				$this -&gt; write($all);
			}
		} else {
			return false;
		}
	}

}</code></pre>
<h2>Usage</h2>
<p>First, you should use your own <strong>$salt</strong>. Change the value of <strong>$salt</strong> in the <strong>Htpasswd</strong> class to something else for your own application.</p>
<p>To instantiate the classes:</p>
<pre><code>$passwdHandler = new <strong>Htpasswd</strong>('/home/myuser/.htpasswd');
$groupHandler = new <strong>Htgroup</strong>('/home/myuser/.htgroup');</code></pre>
<p>To create and delete a user:</p>
<pre><code>// Add a user with name 'user1' and password 'I prefer to use passphrase rather than password.' if it doesn't exist in .htpasswd.
$passwdHandler -&gt; <strong>addUser</strong>('user1', 'I prefer to use passphrase rather than password.');
// Delete the user 'user1' if it exists in .htpasswd.
$passwdHandler -&gt; <strong>deleteUser</strong>('user1');</code></pre>
<p>To check if a particular user exists in .htpasswd:</p>
<pre><code>// Check if user 'user1' exists in .htpasswd.
if ($passwdHandler -&gt; <strong>doesUserExist</strong>('user1')) {
	// User 'user1' exists.
}</code></pre>
<p>To get the clear text password for a particular user (Apache stores passwords in .htpasswd as encoded strings):</p>
<pre><code>// Get the clear password for user 'user1'.
echo $passwdHandler -&gt; <strong>getClearPassword</strong>('user1');</code></pre>
<p>To add a user to a group:</p>
<pre><code>// Add user 'user1' to group 'admin' in .htgroup. Group will be automatically created if it doesn't exist.
$groupHandler -&gt; <strong>addUserToGroup</strong>('user1', 'admin');</code></pre>
<p>To delete a user from a group (user still exists in .htpasswd, just not associated with the group any more):</p>
<pre><code>// Delete user 'user1' from group 'admin' in .htgroup. Group will be automatically removed if it doesn't contain any users.
$groupHandler -&gt; <strong>deleteUserFromGroup</strong>('user1', 'admin');</code></pre>
<h2>Conclusion</h2>
<p>This ain&#8217;t concluded. It&#8217;s just an END notice. Feel free to let me know your thoughts and how my classes work for you.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/09/how-to-create-generate-htpasswd-password-with-php-dynamically.html" rel="bookmark" title="September 18, 2010">How to create / generate .htpasswd password with PHP dynamically?</a></li>
<li><a href="http://www.kavoir.com/2011/10/php-crontab-class-to-add-and-remove-cron-jobs.html" rel="bookmark" title="October 30, 2011">PHP: Crontab Class to Add, Edit and Remove Cron Jobs</a></li>
<li><a href="http://www.kavoir.com/2009/01/php-file-upload-class.html" rel="bookmark" title="January 15, 2009">PHP: File Upload Script (HTML Form + PHP Handler Class)</a></li>
<li><a href="http://www.kavoir.com/2009/08/php-email-attachment-class.html" rel="bookmark" title="August 6, 2009">PHP: Email Attachment Class</a></li>
<li><a href="http://www.kavoir.com/2010/09/php-checking-text-strings-against-reserved-or-censored-words.html" rel="bookmark" title="September 27, 2010">PHP: Checking Text Strings against Reserved or Censored Words</a></li>
</ul>
<p><!-- Similar Posts took 3.100 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/04/php-class-for-handling-htpasswd-and-htgroup-member-login-user-management.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moredays: Beautiful Productivity Tool To Release iOS Apps Soon</title>
		<link>http://www.kavoir.com/2012/03/moredays-beautiful-productivity-tool-to-release-ios-apps-soon.html</link>
		<comments>http://www.kavoir.com/2012/03/moredays-beautiful-productivity-tool-to-release-ios-apps-soon.html#comments</comments>
		<pubDate>Sat, 10 Mar 2012 06:08:51 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Internet Tools]]></category>
		<category><![CDATA[Kavoir & Whatever]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2855</guid>
		<description><![CDATA[I have previously reviewed Moredays, the cool productivity tool that is also fun, right after its Beta launch in October last year. Since then, the digital organizer and scrapbook in one has continued improving, adding in for example the ability to sync with Google Apps, that now makes it pleasure to use. They&#8217;ve stayed true [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I have previously <a href="http://www.kavoir.com/2011/11/moredays-cool-productivity-tool-thats-fun.html">reviewed Moredays</a>, the cool productivity tool that is also fun, right after its Beta launch in October last year.</p>

<p>Since then, the digital organizer and scrapbook in one has continued improving, adding in for example the ability to sync with Google Apps, that now makes it pleasure to use. They&#8217;ve stayed true to focus on photos and graphics, which alone would warrant a second try, but if you were still hesitant, the soon-to-be-released native iOS apps should make you change your mind.</p>
<p><a href="http://www.kavoir.com/wp-content/uploads/2012/03/moredays-screens-blog.jpg" rel="lightbox[2855]" title="moredays screens blog on iphone"><img class="alignnone size-full wp-image-2858" title="moredays screens blog on iphone" src="http://www.kavoir.com/wp-content/uploads/2012/03/moredays-screens-blog.jpg" alt="moredays screens blog on iphone" width="463" height="480" /></a></p>
<p><a href="http://moredays.com">Moredays</a> focuses on bringing the best user experience for each device. Their iPhone app makes the most of the small screen, letting you easily check what&#8217;s on your agenda for any given day or add items on the fly.</p>
<p>The iPad version, on the other hand, seems like a great tool for someone eager to take notes in a meeting or get an overview of the whole week ahead.</p>
<p><a href="http://www.kavoir.com/wp-content/uploads/2012/03/moredays.jpg" rel="lightbox[2855]" title="moredays"><img class="alignnone size-medium wp-image-2859" title="moredays" src="http://www.kavoir.com/wp-content/uploads/2012/03/moredays-300x225.jpg" alt="moredays" width="300" height="225" /></a></p>
<p>Both of these apps are in final stages of development and testing and will be released in the next few weeks. Will you be checking them out?<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/11/moredays-cool-productivity-tool-thats-fun.html" rel="bookmark" title="November 4, 2011">Moredays: Cool Productivity Tool That&#8217;s Fun</a></li>
<li><a href="http://www.kavoir.com/2009/07/a-few-suggestions-of-good-practices-for-accelerating-php-development.html" rel="bookmark" title="July 6, 2009">A few suggestions of good practices for accelerating PHP development</a></li>
<li><a href="http://www.kavoir.com/2009/07/bulk-domain-name-availability-checker-tool-to-batch-check-domain-availability.html" rel="bookmark" title="July 25, 2009">Bulk Domain Name Availability Checker Tool to Batch Search Available Domains</a></li>
<li><a href="http://www.kavoir.com/2009/06/what-is-this-font-an-online-tool-to-detect-or-guess-font-typography-in-images.html" rel="bookmark" title="June 5, 2009">What is this font? An online tool to detect or guess font typography in images</a></li>
<li><a href="http://www.kavoir.com/2009/01/free-wordpress-hosting-and-much-more.html" rel="bookmark" title="January 11, 2009">Free WordPress Hosting and Much More &#8211; DreamHost Apps Free Hosting Invitation</a></li>
</ul>
<p><!-- Similar Posts took 3.111 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/03/moredays-beautiful-productivity-tool-to-release-ios-apps-soon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avalanche Coupon Code (Magento Theme)</title>
		<link>http://www.kavoir.com/2012/02/avalanche-coupon-code-magento-theme.html</link>
		<comments>http://www.kavoir.com/2012/02/avalanche-coupon-code-magento-theme.html#comments</comments>
		<pubDate>Wed, 29 Feb 2012 08:53:33 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Coupons and Promo Codes]]></category>
		<category><![CDATA[eCommerce & Shopping Online]]></category>
		<category><![CDATA[Kavoir & Whatever]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[PayPal & Ecommerce]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2845</guid>
		<description><![CDATA[Jake (fastdivision.com) was kind enough to offer me a coupon code so that my readers can enjoy the Avalanche Magento theme at 15% discount. In case you haven&#8217;t read my review of the Avalanche theme, it is the current sensation going on in the Magento-sphere. In the shortest words, I think it&#8217;s the best Magento [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.kavoir.com/promo/avalanche/" rel="nofollow"><img class="frame alignright size-full wp-image-2846" title="Avalanche Magento theme" src="http://www.kavoir.com/wp-content/uploads/2012/02/Avalanche-Magento-theme.jpg" alt="Avalanche Magento theme" width="320" height="203" /></a>Jake (<a onclick="location.href='/promo/avalanche/'; return false;" href="http://fastdivision.com">fastdivision.com</a>) was kind enough to offer me a coupon code so that my readers can enjoy the <a href="http://www.kavoir.com/promo/avalanche/" rel="nofollow">Avalanche Magento theme</a> at <strong>15%</strong> discount. In case you haven&#8217;t read my <a href="http://www.kavoir.com/2011/12/premium-magento-theme-avalanche-review.html">review of the Avalanche theme</a>, it is the current sensation going on in the Magento-sphere. In the shortest words, I think it&#8217;s the best Magento theme because of 3 reasons:<span id="more-2845"></span></p>
<ol>
<li>It is built by someone who&#8217;s <strong>insanely good</strong> at the website stuff (HTML, CSS, PHP, design, user experience, etc.). and who pursues <strong>perfection</strong>.</li>
<li>It has <strong>unparalleled support</strong> &#8211; read my review and you will know. Better yet, join the club to experience yourself!</li>
<li>The theme is very very good (best is a pretty strong word and I&#8217;ll leave it to you) in all aspects I can think of AND it&#8217;s being pushed to be <strong>better every day</strong>. Read <a onclick="location.href='/promo/avalanche/'; return false;" href="http://fastdivision.com/">Jake&#8217;s blog</a>. He&#8217;s just finished working on and released a mobile version of Avalanche.</li>
</ol>
<h2>Coupon Code for Avalanche</h2>
<p>OK here&#8217;s the coupon part. If you have made up your mind to purchase Avalanche, use this coupon code when checking out:</p>
<pre><strong><a href="http://www.kavoir.com/promo/avalanche/" rel="nofollow">KAVOIR</a></strong></pre>
<p>Just enter it in the &#8220;Enter coupon code&#8221; text box at the end of the checkout page:</p>
<p><a href="http://www.kavoir.com/promo/avalanche/" rel="nofollow"><img class="frame alignnone size-full wp-image-2847" style="background: url('/img/entry/box-bg1.png');" title="Avalanche coupon code for 15% off" src="http://www.kavoir.com/wp-content/uploads/2012/02/avalanche_coupon_code.png" alt="Avalanche coupon code for 15% off" width="491" height="233" /></a></p>
<p>And you will have the <strong>15%</strong> discount off the normal pricing of $199 and $399 which would then be $169.15 and $339.15 respectively. Always nice to save a few bucks.</p>
<p>Enjoy!<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/12/premium-magento-theme-avalanche-review.html" rel="bookmark" title="December 30, 2011">Premium Magento Theme &#8211; Avalanche (Review)</a></li>
<li><a href="http://www.kavoir.com/2010/04/dont-just-create-good-products-but-irresistable-ones-thesis-theme-1-7-review.html" rel="bookmark" title="April 1, 2010">Thesis Theme Review &#8211; Don&#8217;t just create good products but irresistable ones.</a></li>
<li><a href="http://www.kavoir.com/2011/09/magento-go-test-drive-review.html" rel="bookmark" title="September 27, 2011">Magento Go Review &#8211; Sucking Support &#038; $99 Ripoff for SSL Setup</a></li>
<li><a href="http://www.kavoir.com/2009/09/the-planet-dedicated-server-coupon-promo-code-for-50-70-off.html" rel="bookmark" title="September 2, 2009">The Planet Coupon Promo Code for 50% &#8211; 70% Off Dedicated Servers</a></li>
<li><a href="http://www.kavoir.com/2009/01/web-hosting-mosso-discount-coupon-code-control-panel-demo-email-demo.html" rel="bookmark" title="January 20, 2009">Rackspace Cloud $50 Referral Promo Code (Coupon Code for Cloud Sites Discount)</a></li>
</ul>
<p><!-- Similar Posts took 4.604 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/avalanche-coupon-code-magento-theme.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cheapest GoDaddy Promo Code – $1.49 / Year .COM</title>
		<link>http://www.kavoir.com/2012/02/cheapest-godaddy-coupon-code-1-49-year-com.html</link>
		<comments>http://www.kavoir.com/2012/02/cheapest-godaddy-coupon-code-1-49-year-com.html#comments</comments>
		<pubDate>Fri, 24 Feb 2012 01:57:19 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Coupons and Promo Codes]]></category>
		<category><![CDATA[Domains]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2831</guid>
		<description><![CDATA[Just found out a dirt cheap GoDaddy coupon code for new .com registrations: leap149 Which enables you to get any new .com name for just $1.49 for the first year. Not sure if you can claim it more than once per account but I believe one can’t. I used it to quick register one .com [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Just found out a dirt cheap GoDaddy coupon code for new .com registrations:<span id="more-2831"></span></p>
<pre><strong>leap149</strong></pre>
<p>Which enables you to get any new .com name for just <strong>$1.49</strong> for the first year. Not sure if you can claim it more than once per account but I believe one can’t. I used it to quick register one .com domain and never tried it a second time.</p>
<p>This is probably the cheapest GoDaddy coupon code ever for new domain registrations.</p>
<h2>$2.95 / year .COM from GoDaddy</h2>
<p>Another tip for getting cheap .com names from GoDaddy is this one:</p>
<pre><a title="http://www.godaddy.com/domains/search-danica.aspx?isc=goft006ec" href="http://www.godaddy.com/domains/search-danica.aspx?isc=goft006ec">http://www.godaddy.com/domains/search-danica.aspx?isc=goft006ec</a></pre>
<p>It gives you the opportunity to register any new .com names for as many years as you want at just <strong>$2.95 per year</strong> (plus ICANN fee). That’s right, for just $15, you could have a .com name for 5 years. At normal pricing, $15 would only get you one or two years.</p>
<p>I found out this one by discovering one of the GoDaddy AdWords ads. They give amazing offers to traffic from AdWords campaigns.</p>
<p>In my opinion, though $1.49 may seem a lot cheaper than $2.95, I’d still opt to go with the $2.95 / year route because I can register multiple years. $1.49 would just get you locked in and then pay normal next year and so on. GoDaddy doesn’t release many renewal coupon codes as it does new registration codes.</p>
<h2>$7.49 / year .COM renewal code</h2>
<pre><strong>Zine10</strong></pre>
<p>This code gives you $7.49 / year renewal price for .com names at GoDaddy. It&#8217;s said to have been working for at least the last 2 years so hopefully it would go on working.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/01/699-com-domain-coupon-at-godaddy-for-both-registration-and-renewal.html" rel="bookmark" title="January 25, 2009">$6.99 .com domain coupon at GoDaddy for both registration and renewal</a></li>
<li><a href="http://www.kavoir.com/2009/06/the-best-com-renewal-coupon-at-godaddy.html" rel="bookmark" title="June 15, 2009">The best .com renewal coupon at Godaddy</a></li>
<li><a href="http://www.kavoir.com/2010/02/6-99-godaddy-com-renewal-coupon-code.html" rel="bookmark" title="February 12, 2010">$7.49 GoDaddy .com renewal coupon code</a></li>
<li><a href="http://www.kavoir.com/2010/08/godaddy-7-69-org-domain-registration-coupon-promo-code.html" rel="bookmark" title="August 11, 2010">Godaddy $7.69 .org domain registration coupon promo code</a></li>
<li><a href="http://www.kavoir.com/2011/12/com-renewal-promo-code-verisign-com-registry-fee-increases-by-0-5.html" rel="bookmark" title="December 4, 2011">.com Renewal Promo Code &ndash; VeriSign .com Registry Fee Increases by $0.5</a></li>
</ul>
<p><!-- Similar Posts took 2.856 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/cheapest-godaddy-coupon-code-1-49-year-com.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Webmium Review – WYSIWYG Website Builder</title>
		<link>http://www.kavoir.com/2012/02/webmium-review-wysiwyg-website-builder.html</link>
		<comments>http://www.kavoir.com/2012/02/webmium-review-wysiwyg-website-builder.html#comments</comments>
		<pubDate>Thu, 23 Feb 2012 11:18:54 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Business and Marketing]]></category>
		<category><![CDATA[Coupons and Promo Codes]]></category>
		<category><![CDATA[Free Web Templates]]></category>
		<category><![CDATA[Internet Tools]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2810</guid>
		<description><![CDATA[Webmium may not have much to look at on their website – for which they better hurry up and get a better design – it’s actually very very easy and intuitive to use.  With adequate features, abundant site templates to choose from, and hundreds of online marketing guides, it’s the combo solution for people who [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.kavoir.com/go/webmium/"><img class="frame alignright size-full wp-image-2828" title="Webmium 40% Discount Promo Code: KAVOIR" src="http://www.kavoir.com/wp-content/uploads/2012/02/webmium_promo_code.png" alt="Webmium 40% Discount Promo Code: KAVOIR" width="283" height="80" />Webmium</a> may not have much to look at on their website – for which they better hurry up and get a better design – it’s actually very very easy and intuitive to use.  With adequate features, abundant site templates to choose from, and hundreds of online marketing guides, it’s the combo solution for people who want to get their business website up in less than 10 minutes, without having to spend an arm and a leg to tackle the challenges of web design, web development, web hosting, and web marketing. <a href="http://www.kavoir.com/go/webmium/">Webmium</a> has it all.<span id="more-2810"></span></p>
<h2>Unbelievably Easy and Intuitive</h2>
<p>After a few minutes of clicking and typing, my first site on Webmium was up and running – <a href="http://xian.webmium.com/">Xi’an Jobs</a>. I didn’t have to think once to get my job done. Everything seemed to be right there when I needed it. I felt like a breeze being pushed by the wind, naturally and comfortably and never did I have to sweat any effort to accomplish the whole website which is decent enough for most undertakings. Your site is well modularized so that you can freely switch between themes / layout and move around objects without jeopardizing anything. Your content is never hard coded.</p>
<h2>A WYSIWYG Website Editor Better than Desktop Programs</h2>
<p>Everyone can learn and start doing it in a minute. In fact, it’s so intuitive and easy that everything including editing text, uploading image, adding contact form and creating another page is accomplished within one editor page. Check out the editor screenshot:</p>
<p><a href="http://www.kavoir.com/wp-content/uploads/2012/02/webmium_website_editor.jpg" rel="lightbox[2810]" title="webmium website editor"><img class="alignleft size-medium wp-image-2813" title="webmium website editor" src="http://www.kavoir.com/wp-content/uploads/2012/02/webmium_website_editor-300x207.jpg" alt="webmium website editor" width="300" height="207" /></a></p>
<p>You don’t get any more <a href="http://en.wikipedia.org/wiki/WYSIWYG">WYSIWYG</a> than this. Lots of desktop website creator programs such as Adobe Dreamweaver and Microsoft Expression Web available on the market who claim to be WYSIWYG don’t come up close. You have to view the produced web page in a browser to see the final results. But with <a href="http://www.kavoir.com/go/webmium/">Webmium</a>, it’s all in there, 100% WYSIWYG and never again do you have to scratch your head and ask why the hell does it look so different in the browser from that in the editor.</p>
<h2>Free Entry Plan – Very Good for SEO</h2>
<p>Best of all it’s free and they’ve got tons of FREE templates to choose from. You should get one up on Webmium right now. <a href="http://www.kavoir.com/go/webmium/">Sign up</a> with them. It’s definitely worth the time to have an external page of content up for the sake of SEO. Be sure to create useful, original and rich content or Google won’t buy it just because it’s on a distant IP. Webmium has an auto-submission feature that after you have published your site it will automatically submit the site to search engines like Google.</p>
<p class="alert">My tiny site about Xi&#8217;an Jobs ( <a href="http://xian.webmium.com/">http://xian.webmium.com/</a> ) was indexed by Google <strong>8 hours</strong> after being published at Webmium. Definitely looks promising from the perspective of SEO.</p>
<h2>Quick Built-in Guides to Kick Start Your Online Marketing</h2>
<p>For small business owners who don’t know how to have their own website online, <a href="http://www.kavoir.com/go/webmium/">Webmium</a> is the no-brainer choice. It has got hundreds of articles and guides in the <strong>Marketing Academy</strong> on how to do it and what the best practices are, about not only the technical aspects but also the marketing part. It’s a perfect companion for starter small businesses owners who want to have their website up <strong>today</strong>, in the minimum effort and cost possible. And you are well guided along the way with built-in tips while you are building your online presence.</p>
<h2>What can be improved about Webmium?</h2>
<p>It’s a greatly simple and useful solution for starter business owners but there are definitely ways that <a href="http://www.kavoir.com/go/webmium/">Webmium</a> can be improved. I’ll just lay out a few of the problems I met when playing with it:</p>
<ol>
<li>Currently there’s no way I can add text beside the logo. It’s either a logo or a text but you can&#8217;t combine.</li>
<li>I don’t seem to be able to align social buttons such as facebook like buttons and tweet buttons together. Weird.</li>
<li>Unable to modify footer attribution to add copyright notice, etc. I guess it’s because I’m on the free plan. You would probably be able to do that after upgrading to the <a href="http://www.kavoir.com/go/webmium/">PRO plan</a>.</li>
<li>For now, each account is limited to one website / domain. I think they can definitely offer the ability to create and manage multiple websites under one account in the PRO plan.</li>
</ol>
<p>Other than these, Webmium is looking a prosperous future if they keep shaping it better.</p>
<h2>Upgrading to PRO? Use a Promo Code!</h2>
<p><a href="http://www.kavoir.com/go/webmium/">Webmium</a> was kind enough to offer an exclusive promo code to the readers of Kavoir.com. If you want to take advantage of the PRO plan that offers all the easiness to build a small business website as well as unlimited storage and bandwidth, use promo code:</p>
<p><strong style="font-size: 2.5em;"><a href="http://www.kavoir.com/go/webmium/">KAVOIR</a></strong></p>
<p>Like this:</p>
<p><a href="http://www.kavoir.com/go/webmium/"><img class="frame" title="Webmium Promo Code" src="http://www.webmiumpromocode.com/files/2012/02/webmium_promo_code.png" alt="Webmium Promo Code" /></a></p>
<p>When you are upgrading but before making payment. It would give you a nice <strong>40% discount</strong> off the listed price.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/12/turn-your-blog-or-business-into-a-marketing-machine.html" rel="bookmark" title="December 1, 2011">Turn Your Blog or Business Into A Marketing Machine</a></li>
<li><a href="http://www.kavoir.com/2011/03/vbulletin-how-to-add-more-buttons-to-quick-reply-box-toolbar.html" rel="bookmark" title="March 26, 2011">vBulletin: How to add more buttons to quick reply box toolbar?</a></li>
<li><a href="http://www.kavoir.com/2010/05/a-simple-business-web-template-with-php-contact-form.html" rel="bookmark" title="May 5, 2010">A simple business web template with PHP contact form</a></li>
<li><a href="http://www.kavoir.com/2011/07/microsoft-office-365-review-screenshots-what-will-you-get.html" rel="bookmark" title="July 15, 2011">Microsoft Office 365 Review &#038; Screenshots &#8211; What will you get?</a></li>
<li><a href="http://www.kavoir.com/2010/09/free-php-business-directory-script.html" rel="bookmark" title="September 29, 2010">Free PHP Business Directory Script</a></li>
</ul>
<p><!-- Similar Posts took 2.932 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/webmium-review-wysiwyg-website-builder.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Strip or Trim Extra Whitespaces Inside a String</title>
		<link>http://www.kavoir.com/2012/02/php-strip-or-trim-extra-whitespaces-inside-a-string.html</link>
		<comments>http://www.kavoir.com/2012/02/php-strip-or-trim-extra-whitespaces-inside-a-string.html#comments</comments>
		<pubDate>Tue, 14 Feb 2012 04:24:52 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2805</guid>
		<description><![CDATA[There are raw strings that contain extraly unwanted whitespaces (tabs, spaces, new lines) that you want to get rid of so as to form a normalized string that has only a single spaces between words and sentences. For instance, you may want to transform this string: Morning is here, sunshine is here. Morning is here. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>There are raw strings that contain extraly unwanted whitespaces (tabs, spaces, new lines) that you want to get rid of so as to form a normalized string that has only a single spaces between words and sentences. For instance, you may want to transform this string:</p>

<pre>Morning   is here,   sunshine
   is here.    Morning is    here.</pre>
<p>Into this:</p>
<pre>Morning is here, sunshine is here. Morning is here.</pre>
<p>How to achieve this in PHP?</p>
<p>Just use this function:</p>
<pre><code>function purge_inside_whitespaces($text) {
	while (preg_match('/\s{2}/', $text)) {
		$text = preg_replace('/\s{2}/', ' ', $text);
	}
	return $text;
}</code></pre>
<p>Basically, it keeps scouring through the $text string passed to it and removes any continuous whitespaces and replace them with single spaces, until it can’t find any more continuous whitespaces.</p>
<p>Note you would need to apply <strong>trim</strong>() to get rid of any whitespaces in the beginning or at the end of the string, because if there are any there, a single space would still remain after applying <strong>purge_inside_whitespaces</strong>().</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/05/mysql-replace-substring-with-another-string-the-mysql-string-replace-function.html" rel="bookmark" title="May 16, 2009">MySQL: Replace Substring with Another String &ndash; the MySQL String Replace Function</a></li>
<li><a href="http://www.kavoir.com/2009/04/php-change-tabs-to-spaces-and-vice-versa-in-string-change-tab-sizes-lengths-in-strings.html" rel="bookmark" title="April 23, 2009">PHP: Change Tabs to Spaces and Vice Versa in String | Change Tab Sizes / Lengths in Strings</a></li>
<li><a href="http://www.kavoir.com/2009/06/javascript-split-and-divide-text-string-by-a-delimiter.html" rel="bookmark" title="June 16, 2009">JavaScript: Split and Divide Text String by A Delimiter</a></li>
<li><a href="http://www.kavoir.com/2009/12/php-regular-expression-matching-input-subject-string-length-limit.html" rel="bookmark" title="December 12, 2009">PHP: Subject String Length Limit of Regular Expression Matching Functions</a></li>
<li><a href="http://www.kavoir.com/2009/04/dealing-with-php-command-line-programs-scripts-run-on-shell-and-the-arguments.html" rel="bookmark" title="April 22, 2009">Dealing with PHP command line programs / scripts run on shell and the arguments</a></li>
</ul>
<p><!-- Similar Posts took 2.414 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/php-strip-or-trim-extra-whitespaces-inside-a-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspirational Music &amp; Uplifting Tunes</title>
		<link>http://www.kavoir.com/2012/02/simply-inspirational-music-uplifting-tunes.html</link>
		<comments>http://www.kavoir.com/2012/02/simply-inspirational-music-uplifting-tunes.html#comments</comments>
		<pubDate>Wed, 08 Feb 2012 06:44:38 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2741</guid>
		<description><![CDATA[People close to me would know that I play piano for fun &#8211; not an advanced player but the best I can do is Beethoven&#8217;s Moonlight Sonata (only the 1st movement, -_-). I think everyone could learn one or two musical instruments and amuse themselves. Music is such a great endowment to us. It dispels the [...]]]></description>
			<content:encoded><![CDATA[<p><a class="post_image_link" href="http://www.kavoir.com/2012/02/simply-inspirational-music-uplifting-tunes.html" title="Permanent link to Inspirational Music &#038; Uplifting Tunes"><img class="post_image alignleft" src="http://www.kavoir.com/wp-content/uploads/2012/02/nature-sounds.jpg" width="140" height="140" alt="Inspirational Music" /></a>
</p><p>People close to me would know that I play piano for fun &#8211; not an advanced player but the best I can do is <a href="http://www.youtube.com/watch?v=nT7_IZPHHb0">Beethoven&#8217;s Moonlight Sonata</a> (only the 1st movement, -_-). I think everyone could learn one or two musical instruments and amuse themselves. Music is such a great endowment to us. It dispels the dismay, enriches our emotions and reignites the dreams for a beautiful life. A week ago I found some very nice music tunes at <a href="http://audiojungle.net/popular_item/by_category?category=music&amp;ref=ichsie">Audio Jungle</a> (link to their most popular pieces) that is so inspirational and upbeatly pleasant. I can&#8217;t help but being motivated to be happy and creative. They are so simple yet so masterly composed. Listed below are what I like most. Hopefully they would resonate in you as well.<span id="more-2741"></span></p>
<h2><img class="alignleft size-full wp-image-2759" title="Metro Light Music" src="http://www.kavoir.com/wp-content/uploads/2012/02/224500.png" alt="Metro Light Music" width="80" height="80" />Live My Life</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/live-my-life/224500?ref=ichsie">http://audiojungle.net/item/live-my-life/224500</a></p>
<h2><img class="alignleft size-full wp-image-2760" title="Melodality" src="http://www.kavoir.com/wp-content/uploads/2012/02/72668.png" alt="Melodality" width="80" height="80" />A Fortunate Day</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/a-fortunate-day-extended-version/72668?ref=ichsie">http://audiojungle.net/item/a-fortunate-day-extended-version/72668</a></p>
<h2><img class="alignleft size-full wp-image-2779" title="Audio Quattro" src="http://www.kavoir.com/wp-content/uploads/2012/02/95370.jpg" alt="Audio Quattro" width="80" height="80" />Clouds</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/clouds/95370?ref=ichsie">http://audiojungle.net/item/clouds/95370</a></p>
<h2><img class="alignleft size-full wp-image-2777" title="Sweetwave Audio" src="http://www.kavoir.com/wp-content/uploads/2012/02/854045.jpg" alt="Sweetwave Audio" width="80" height="80" />Seeing is Believing</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/seeing-is-believing/854045?ref=ichsie">http://audiojungle.net/item/seeing-is-believing/854045</a></p>
<h2><img class="alignleft size-full wp-image-2783" title="Soundroll" src="http://www.kavoir.com/wp-content/uploads/2012/02/162200.jpg" alt="Soundroll" width="80" height="80" />A Way To The Top</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/a-way-to-the-top/162200?ref=ichsie">http://audiojungle.net/item/a-way-to-the-top/162200</a></p>
<h2><img class="alignleft size-full wp-image-2786" title="BeatheBeat" src="http://www.kavoir.com/wp-content/uploads/2012/02/94451.jpg" alt="BeatheBeat" width="80" height="80" />Positive Thinking</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/positive-thinking/94451?ref=ichsie">http://audiojungle.net/item/positive-thinking/94451</a></p>
<h2><img class="alignleft size-full wp-image-2789" title="Tim Mcmorris" src="http://www.kavoir.com/wp-content/uploads/2012/02/1299157.jpg" alt="Tim Mcmorris" width="80" height="80" />Translation</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/translation/1299157?ref=ichsie">http://audiojungle.net/item/translation/1299157</a></p>
<h2><img class="alignleft size-full wp-image-2790" title="Dirtyflint" src="http://www.kavoir.com/wp-content/uploads/2012/02/Dirtyflint.jpg" alt="Dirtyflint" width="80" height="80" />Energetic Corporate Pack</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/energetic-corporate-pack/1197765?ref=ichsie">http://audiojungle.net/item/energetic-corporate-pack/1197765</a></p>
<h2><img class="alignleft size-full wp-image-2760" title="Melodality" src="http://www.kavoir.com/wp-content/uploads/2012/02/72668.png" alt="Melodality" width="80" height="80" />Business Music Pack</h2>
<p style="margin-top: -2em; font: 0.7em Verdana;">Source: <a href="http://audiojungle.net/item/business-music-pack/108020?ref=ichsie">http://audiojungle.net/item/business-music-pack/108020</a></p>
<p>&nbsp;</p>
<p>For people into classical music, here&#8217;s one of my sites: <a href="http://www.topclassicalmusic.com/">Top Classical Music</a>. It tries to collect the best pieces of classical music arranged by authors and their epoch. Since fine MP3 files with impeccable quality are hard to come by, it&#8217;s very far from complete. I&#8217;ll try and get more pieces on the site when I can.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2011/11/skype-free-live-chat-for-your-website-show-onlineoffline-status-button.html" rel="bookmark" title="November 2, 2011">Skype: Free Live Chat for Your Website &#8211; Show Online/Offline Status Button</a></li>
<li><a href="http://www.kavoir.com/2009/01/free-reverse-domain-ip-tool-for-other-websites-or-domains-on-the-same-server.html" rel="bookmark" title="January 11, 2009">Free Reverse Domain &amp; IP Tool for Other Websites or Domains on the Same Server</a></li>
<li><a href="http://www.kavoir.com/2009/06/play-audio-mp3-wav-on-a-html-web-page-with-simple-flash-audio-player.html" rel="bookmark" title="June 30, 2009">Play audio (MP3, WAV, &#8230;) on a HTML web page with simple Flash audio player</a></li>
<li><a href="http://www.kavoir.com/2009/03/why-simplicity-is-the-king-of-kings.html" rel="bookmark" title="March 21, 2009">Why Simplicity is the King of Kings</a></li>
<li><a href="http://www.kavoir.com/2010/03/use-relative-protocol-url-address-to-automatically-determine-web-address-protocol-http-or-https.html" rel="bookmark" title="March 6, 2010">Use Relative Protocol URL Address to Automatically Determine Web Address Protocol (HTTP or HTTPS)</a></li>
</ul>
<p><!-- Similar Posts took 2.896 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/simply-inspirational-music-uplifting-tunes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.jointlyhosted.com/media/Translation.mp3" length="8840880" type="audio/mpeg" />
<enclosure url="http://www.jointlyhosted.com/media/Clouds.mp3" length="2768479" type="audio/mpeg" />
		</item>
		<item>
		<title>MySQL: LOAD DATA LOCAL INFILE only imports 1 or 2 rows?</title>
		<link>http://www.kavoir.com/2012/02/mysql-load-data-local-infile-only-imports-1-or-2-rows.html</link>
		<comments>http://www.kavoir.com/2012/02/mysql-load-data-local-infile-only-imports-1-or-2-rows.html#comments</comments>
		<pubDate>Tue, 07 Feb 2012 01:23:04 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[SQL / MySQL Tips and Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2739</guid>
		<description><![CDATA[It is common to import CSV files into MySQL database. You can do this with phpMyAdmin with small CSV files but with large ones, you would probably encounter the memory error and had to switch to MySQL command line “LOAD DATA LOCAL INFILE” to do the job. It looks like something like this: LOAD DATA [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It is common to import CSV files into MySQL database. You can do this with phpMyAdmin with small CSV files but with large ones, you would probably encounter the memory error and had to switch to MySQL command line “LOAD DATA LOCAL INFILE” to do the job.</p>

<p>It looks like something like this:</p>
<pre><code>LOAD DATA LOCAL INFILE 'your.csv'
INTO TABLE `your_table`
FIELDS TERMINATED BY ','
ENCLOSED BY '&quot;'
LINES TERMINATED BY '\n'
(field1, field2, field3)</code></pre>
<p>And then you encounter another problem that it only imports the first 1 or 2 rows and then it stops. After some researching and trying, I was sure it’s something to do with the “<strong>LINES TERMINATED BY</strong>” directive. Depending on the platform that the CSV file is created on, the line delimiter may be</p>
<ol>
<li><strong>\n</strong> </li>
<li><strong>\r\n</strong> </li>
<li><strong>\r</strong> </li>
</ol>
<p>And you need to be correct on the line delimiter to properly parse the CSV file. </p>
<p>So the solution is to <strong>try them all</strong> one by one and see which one of them works. Chances are, one of them would make the whole command successfully import ALL rows.</p>
<p>Another simple approach is to deprive the whole command of the “<strong>LINES TERMINATED BY</strong>” directive and let MySQL do the call. It’ll probably detect things right but in my case, this doesn’t work but specifying ‘\r’.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2010/11/mysql-export-table-to-csv-text-files-for-excel.html" rel="bookmark" title="November 18, 2010">MySQL: Export Table to CSV Text Files for Excel</a></li>
<li><a href="http://www.kavoir.com/2010/10/mysql-log-files-are-taking-a-lot-of-disk-space-how-to-disable-and-delete-them.html" rel="bookmark" title="October 25, 2010">MySQL log files are taking a lot of disk space &ndash; How to disable and delete them?</a></li>
<li><a href="http://www.kavoir.com/2009/03/sql-randomly-shuffle-rows-or-records-reorder-them-in-a-random-order.html" rel="bookmark" title="March 23, 2009">SQL: Randomly Shuffle Rows or Records &ndash; Reorder them in a random order</a></li>
<li><a href="http://www.kavoir.com/2011/02/mysql-how-to-export-a-database-table-to-xml.html" rel="bookmark" title="February 17, 2011">MySQL: How to export a database / table to XML?</a></li>
<li><a href="http://www.kavoir.com/2009/05/mysql-update-multiple-rows-with-one-single-query.html" rel="bookmark" title="May 17, 2009">MySQL: Update Multiple Rows or Records with One Single Query</a></li>
</ul>
<p><!-- Similar Posts took 10.411 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/mysql-load-data-local-infile-only-imports-1-or-2-rows.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invoicera Review – Online Invoice Software &amp; Client Billing Software</title>
		<link>http://www.kavoir.com/2012/02/invoicera-for-invoicing-project-time-tracking.html</link>
		<comments>http://www.kavoir.com/2012/02/invoicera-for-invoicing-project-time-tracking.html#comments</comments>
		<pubDate>Sat, 04 Feb 2012 01:11:20 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Internet Tools]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2704</guid>
		<description><![CDATA[Let’s be honest here. One of the most dreaded dreams for any working professionals perhaps is generating timely and professional invoices. Important as they are for ensuring timely payments, it is a pain to sacrifice time and make an effort to track down all the details. If you are having a tough time preparing invoices [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Let’s be honest here. One of the most dreaded dreams for any working professionals perhaps is generating timely and professional invoices. Important as they are for ensuring timely payments, it is a pain to sacrifice time and make an effort to track down all the details. If you are having a tough time preparing invoices and the accompanying reports, a valued solution that lies with you is <a href="http://www.invoicera.com/">Invoicera.</a> Invoicera is a completely web hosted application that effortlessly works towards getting the invoice generation job done, in a professional manner.</p>

<p>A sturdy <a href="http://www.invoicera.com/">online invoicing</a> and billing application, Invoicera provides you with a self explanatory user interface along with poignant and much sought after set of features and functionalities. Thus it seamlessly simplify and streamline the entire process of generating and sending invoices.</p>
<p><a title="Invoicera control panel" href="http://www.kavoir.com/wp-content/uploads/2012/02/invoicera_control_panel.png" rel="lightbox[2687]" target="_blank"><img title="Invoicera control panel" class="frame" src="http://www.kavoir.com/wp-content/uploads/2012/02/invoicera_control_panel-300x211.png" alt="Invoicera control panel" width="300" height="211" /></a></p>
<p><strong>Language Multiplicity and Multicurrency support</strong></p>
<p>This is a major factor, which gives Invoicera an edge over various other online billing systems in the market. Invoicera supports 11 different languages and more than 100 currencies.</p>
<p><strong>Effortlessly Manage Your Clients</strong></p>
<p>In the client section apart from managing and adding your new clients you can also view their account statements and create custom fields and entries which you deem necessary.</p>
<p>To overview the complete details of any particular client there is an automated Report generator, which gives you the ease of analyzing the dealings and business you have had with the customer.</p>
<p><strong>Incredible Time Tracking</strong></p>
<p>With its expert time tracking capabilities, you can be rest assured to track down every minute of your time that you have spent on the projects for your clients. It completely nullifies all the worries surrounding time tracking and you can easily keep a check on how much time you have spent on a particular project.</p>
<p><strong>Template Customization Service</strong></p>
<p>In case you are not technically trained in customizing the look of the invoice / setimate templates, Invoicera provides you with the option of Invoice Template Customization service. This will provide you with the expert services of seasoned technical experts and you can easily customize the look of the invoice that you send, as per the need of your business.</p>
<p><strong>Schedule Your Invoices Easily &amp; Charge Late Fee from Defaulters</strong></p>
<p>A stand out point of Invoicera is that unlike other similar apps, with Invoicera you can easily schedule each of the invoices needed to be delivered. You can simply schedule the date and time on which you need to send out the invoices to the users and the intuitive online invoicing solution that Invoicera is, it will make sure that invoices are delivered right on scheduled time. Besides, with just a click of the mouse, you can add the late fee charges and get reimbursed for the same.</p>
<p><strong>Other Benefits That Invoicera Offers:</strong></p>
<ul>
<li>Login and carry out some invoicing tasks wherever you have access to the Internet either via PC or laptop,</li>
<li>Flexible pricing depending on your usage levels,</li>
<li>Constant updates and support,</li>
<li>No large up front application costs,</li>
<li>Data security and backup</li>
</ul>
<p><strong>In Short</strong></p>
<p>Invoicera is vast enough to confound all the different invoicing requirements of your web site and you assure yourself productive gains by availing its services. Besides, their customer support and related services are impeccable and unmatched. Thus if at any time you stumble, Invoicera provides you with enough options to continue the smooth sailing.</p>
<p><img title="Invoicera - online invoicing" class="frame" src="http://www.kavoir.com/wp-content/uploads/2012/02/invoicera-online-invoicing.jpg" style="background:url(/img/entry/box-bg3.png) repeat 0 0" alt="Invoicera - online invoicing" width="585" height="303" /><br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/hosting-differences-between-paircom-and-pairlitecom.html" rel="bookmark" title="April 21, 2009">Hosting Differences between Pair.com and PairLite.com</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-damn-premium-wordpress-theme-for-professional-bloggers-thesis.html" rel="bookmark" title="June 15, 2009">Best Damn Premium WordPress Theme for Professional Blogs: THESIS</a></li>
<li><a href="http://www.kavoir.com/2010/05/create-contact-and-survey-forms-with-formkid-com-the-free-online-form-builder.html" rel="bookmark" title="May 24, 2010">Create Contact and Survey Forms with FormKid.com the Free Online Form Builder</a></li>
<li><a href="http://www.kavoir.com/2009/03/free-online-skills-test-for-freelance-web-developers-and-programmers-php-mysql-xhtml-css-javascript-and-more.html" rel="bookmark" title="March 4, 2009">Free Online Skills Test for Freelance Web Developers and Programmers: PHP, MySQL, (X)HTML, CSS, JavaScript and More</a></li>
<li><a href="http://www.kavoir.com/2009/06/apache-php-get-client-browser-http-request-headers-information.html" rel="bookmark" title="June 2, 2009">Apache, PHP: Get Client Browser HTTP Request Headers Information</a></li>
</ul>
<p><!-- Similar Posts took 3.097 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/02/invoicera-for-invoicing-project-time-tracking.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress: Display Ads in Post Content and Only Display Ads in Old Posts</title>
		<link>http://www.kavoir.com/2012/01/wordpress-display-ads-in-post-content-and-only-display-ads-in-old-posts.html</link>
		<comments>http://www.kavoir.com/2012/01/wordpress-display-ads-in-post-content-and-only-display-ads-in-old-posts.html#comments</comments>
		<pubDate>Wed, 25 Jan 2012 04:57:02 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[Make Money Online]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[WordPress How To]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2666</guid>
		<description><![CDATA[The title pretty much says it all. It’s 2 of the most useful AdSense ads tips for bloggers in my opinion. Obtrusive ads have the unnecessary effect of driving away readers after they have found what they needed. Unless you have amazingly great content, the chance of them becoming a loyal reader is rather low [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The title pretty much says it all. It’s 2 of the most useful AdSense ads tips for bloggers in my opinion. Obtrusive ads have the unnecessary effect of driving away readers after they have found what they needed. Unless you have amazingly great content, the chance of them becoming a loyal reader is rather low when you have ads splashing into their faces – this is not something you want to do to your subscribed readers. On the other hand, you’d want to maximize your AdSense earnings by putting up ads on as many posts as possible. </p>

<h2>Ad Injection (WP plugin)</h2>
<p>This tiny little plugin, <a href="http://wordpress.org/extend/plugins/ad-injection/">Ad Injection</a>, gets it all. Very useful plugin for you to insert AdSense ads in your blog posts AND set a specific age threshold for the posts to display ads, so freshly published articles won’t have ads to drive your subscribers away. See detailed introduction here: <a href="http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/">Ad Injection for WordPress</a>.</p>
<p>Just install it from the inventory (upload or install from within your WP administrator panel) and activate it. Go to <strong>Settings</strong> &gt; <strong>Ad Injection</strong> &gt; “<strong>Random ad (inserted randomly between paragraphs)</strong>” and insert your AdSense code there. Depending on how aggressive you are, you can use a variety of ad formats from Google. I used a 468&#215;15 links banner on <a href="http://www.healthnot.com/what-is-brights-disease~374">Health Not</a>. Check out the screenshot below:</p>
<p><a href="http://www.healthnot.com/what-is-brights-disease~374"><img class="frame" title="insert ads in wordpress posts" alt="insert ads in wordpress posts" src="http://www.kavoir.com/wp-content/uploads/2012/01/ad-injection-adsense.png" width="485" height="500" /></a></p>
<p>By default, Ad Injection inserts a maximum of 2 instances of the <strong>Random ad</strong> per post. This way, the ads are well blended in the content. What works a few years back with the 336 square ad format on top of the content is gradually dying out in CTR thus click revenues. You should try something new such as this.</p>
<p>Another useful option of the plugin is to set “<strong>Only show normal ads on pages older than xx (days) &#8211; only for single posts and pages</strong>”. This would prove very useful if you want a good balance between ad performance / earnings and user experiences. Only displaying ads on older posts are a pretty good idea for creating a good first impression to those who stumble upon your site.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/02/wordpress-show-recent-posts-on-homepage-or-in-sidebar.html" rel="bookmark" title="February 27, 2009">WordPress: Show Recent Posts on Homepage or in Sidebar</a></li>
<li><a href="http://www.kavoir.com/2010/09/auto-generated-content-by-user-searches.html" rel="bookmark" title="September 29, 2010">Auto-generated content by user searches</a></li>
<li><a href="http://www.kavoir.com/2012/01/aweber-mailchimp-alternative-free-email-autoresponder-subscription.html" rel="bookmark" title="January 12, 2012">Aweber, Mailchimp Alternative &#8211; Free Email Autoresponder Subscription</a></li>
<li><a href="http://www.kavoir.com/2009/05/mysql-insert-if-doesnt-exist-otherwise-update-the-existing-row.html" rel="bookmark" title="May 2, 2009">MySQL: Insert if doesn&rsquo;t exist otherwise update the existing row</a></li>
<li><a href="http://www.kavoir.com/2010/07/my-online-income-report-june-2010.html" rel="bookmark" title="July 23, 2010">My online income report &ndash; June, 2010</a></li>
</ul>
<p><!-- Similar Posts took 5.022 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/01/wordpress-display-ads-in-post-content-and-only-display-ads-in-old-posts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Check if A String Contain Only Uppercase / Capital Letters</title>
		<link>http://www.kavoir.com/2012/01/php-check-if-a-string-contain-only-uppercase-capital-letters.html</link>
		<comments>http://www.kavoir.com/2012/01/php-check-if-a-string-contain-only-uppercase-capital-letters.html#comments</comments>
		<pubDate>Fri, 20 Jan 2012 06:32:44 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[PHP Tips & Tutorials]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2663</guid>
		<description><![CDATA[Sometimes you would want to check if a string is an acronym or an abbreviation by testing if it only contains capitalized letters from A to Z and nothing else. There are 2 ways to accomplish this simple task in PHP. ctype_upper() Use the native ctype_upper() function and you will know if the provided string [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes you would want to check if a string is an acronym or an abbreviation by testing if it only contains capitalized letters from <strong>A to Z</strong> and nothing else. There are 2 ways to accomplish this simple task in PHP.</p>

<h2>ctype_upper()</h2>
<p>Use the native <a href="http://php.net/manual/en/function.ctype-upper.php">ctype_upper</a>() function and you will know if the provided string contains only uppercase letters:</p>
<pre><code>if (<strong>ctype_upper</strong>($string)) {
	echo $string.' is all uppercase letters.';
} else {
	echo $string.' is not all uppercase letters.';
}</code></pre>
<p>The <a href="http://www.php.net/manual/en/ref.ctype.php">Ctype functions</a> would turn out to be very handy when you want to test a string against different character types – digits, alphabetic, alpha-numeric, lowercase letters, uppercase letter, and even punctuations, etc. See the full list here: <a href="http://www.php.net/manual/en/ref.ctype.php">http://www.php.net/manual/en/ref.ctype.php</a></p>
<h2>strtoupper()</h2>
<p>Use the <strong>strtoupper</strong>() function to transform the string into all uppercase characters that’s capitalized letters, and then compare the transformed string against the original one to see if they are identical. If they are, then you are pretty sure the original string was also a string consisting of ONLY capital letters.</p>
<pre><code>if (<strong>strtoupper($string) == $string</strong>) {
	echo $string.' is all uppercase letters.';
}</code></pre>
<h2>Check if A String Consists of Only Lowercase Letters</h2>
<p>The same goes true if you want to do the test other way around. Just use <strong>ctype_lower</strong>() and <strong>strtolower</strong>() instead.</p>
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/04/php-string-case-uppercase-all-letters-or-lowercase-all-letters-in-a-string-uppercase-first-letter-of-a-string-uppercase-first-letter-of-all-words-in-a-string.html" rel="bookmark" title="April 23, 2009">PHP String Case: Uppercase all Letters or Lowercase all Letters in a String | Uppercase First Letter of a String | Uppercase First Letter of all Words in a String</a></li>
<li><a href="http://www.kavoir.com/2011/04/php-class-converting-plural-to-singular-or-vice-versa-in-english.html" rel="bookmark" title="April 3, 2011">PHP Class: Convert Plural to Singular or Vice Versa in English</a></li>
<li><a href="http://www.kavoir.com/2010/09/php-checking-text-strings-against-reserved-or-censored-words.html" rel="bookmark" title="September 27, 2010">PHP: Checking Text Strings against Reserved or Censored Words</a></li>
<li><a href="http://www.kavoir.com/2009/06/php-change-array-key-case-all-array-keys-to-lowercase-or-uppercase.html" rel="bookmark" title="June 2, 2009">PHP: Change Array Key Case &#8211; All Array Keys to Lowercase or Uppercase</a></li>
<li><a href="http://www.kavoir.com/2009/06/php-create-an-array-of-a-range-of-characters-numbers-or-letters-or-multiple-identical-values.html" rel="bookmark" title="June 2, 2009">PHP: Create an Array of A Range of Characters (Numbers or Letters) or Multiple Identical Values</a></li>
</ul>
<p><!-- Similar Posts took 2.820 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/01/php-check-if-a-string-contain-only-uppercase-capital-letters.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customize WordPress Post Editor CSS Styles</title>
		<link>http://www.kavoir.com/2012/01/customize-wordpress-post-editor-css-styles.html</link>
		<comments>http://www.kavoir.com/2012/01/customize-wordpress-post-editor-css-styles.html#comments</comments>
		<pubDate>Thu, 19 Jan 2012 14:16:39 +0000</pubDate>
		<dc:creator>Yang Yang</dc:creator>
				<category><![CDATA[WordPress How To]]></category>

		<guid isPermaLink="false">http://www.kavoir.com/?p=2652</guid>
		<description><![CDATA[Do you know you can actually change the CSS styles of the entire editing area / editor where you create the post content in WordPress? It doesn&#8217;t have to be the default styles and since version 3.0, people can freely style the TinyMCE rich text editor shipped with WordPress however they want to by a few [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Do you know you can actually change the CSS styles of the entire editing area / editor where you create the post content in WordPress? It doesn&#8217;t have to be the default styles and since version 3.0, people can freely style the <a href="http://www.tinymce.com/">TinyMCE</a> rich text editor shipped with <a href="http://www.wordpress.org/">WordPress</a> however they want to by a few simple changes to the theme files.<span id="more-2652"></span></p>
<h2>Step 1</h2>
<p>Open the <strong>functions.php</strong> file in your theme folder (create it if it doesn&#8217;t exist) and add this line anywhere in the PHP tags &lt;?php &#8230; ?&gt;:</p>
<pre>add_editor_style();</pre>
<h2>Step 2</h2>
<p>Create a css file named <strong>editor-style.css</strong> and put it in the theme root, namely the same folder where functions.php is in. To start with, you may want to copy the CSS styles from that of the <a href="http://www.kavoir.com/wp-content/themes/twentyeleven/editor-style.css">Twenty Eleven theme</a> into yours.</p>
<p>Now you can freely change those styles (such as rich text font, size or color, etc.) to have your own customized WordPress editor styles. The default editor styles coming with Twenty Eleven are very nice that make me long to write. So I&#8217;m now using them for my editor in the current theme, <a href="http://www.kavoir.com/2010/04/dont-just-create-good-products-but-irresistable-ones-thesis-theme-1-7-review.html">Thesis</a>. You should too, if you find it more inspiring than the default styles.<br />
<h3>Related Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.kavoir.com/2009/01/update-your-theme-to-wordpress-27-with-comments-threading-and-paging.html" rel="bookmark" title="January 15, 2009">Update your theme to WordPress 2.7 with Comments Threading and Paging</a></li>
<li><a href="http://www.kavoir.com/2011/03/vbulletin-change-default-height-of-quick-reply-box-and-enlarge-it.html" rel="bookmark" title="March 26, 2011">vBulletin: Change default height of editor and quick reply box</a></li>
<li><a href="http://www.kavoir.com/2012/05/customize-wordpress-login-header-and-link-upgrade-proof-without-plugin.html" rel="bookmark" title="May 12, 2012">Customize WordPress Login Header and Link, Upgrade-proof without Plugin</a></li>
<li><a href="http://www.kavoir.com/2009/06/html-change-text-and-font-colors.html" rel="bookmark" title="June 16, 2009">HTML: Change Text and Font Colors</a></li>
<li><a href="http://www.kavoir.com/2009/01/css-selectorhover-hack-for-ie6.html" rel="bookmark" title="January 19, 2009">CSS selector:hover Hack for IE6</a></li>
</ul>
<p><!-- Similar Posts took 4.481 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kavoir.com/2012/01/customize-wordpress-post-editor-css-styles.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 2.504 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-17 04:49:53 -->

