<?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>NewSourceMedia Blog &#187; non-alphanumeric</title>
	<atom:link href="http://newsourcemedia.com/blog/tag/non-alphanumeric/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Sun, 09 May 2010 02:35:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Php Remove Non-Alphanumeric Characters</title>
		<link>http://newsourcemedia.com/blog/php-remove-non-alphanumeric-characters/</link>
		<comments>http://newsourcemedia.com/blog/php-remove-non-alphanumeric-characters/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Manipulation]]></category>
		<category><![CDATA[characters]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[non-alphanumeric]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[preg match]]></category>
		<category><![CDATA[strip]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2006/12/27/php-remove-non-alphanumeric-characters/</guid>
		<description><![CDATA[How to strip all symbols and numbers from a string  of alphanumeric text. This php code will help you delete, remove, strip and erase any non-alphanumeric characters, and then return the data without the unwanted characters.
Need help removing un-wanted characters from your php text form strings. Here&#8217;s how to  strip a string of [...]]]></description>
			<content:encoded><![CDATA[<p>How to strip all symbols and numbers from a string  of alphanumeric text. This php code will help you delete, remove, strip and erase any non-alphanumeric characters, and then return the data without the unwanted characters.<span id="more-178"></span></p>
<p>Need help removing un-wanted characters from your php text form strings. Here&#8217;s how to  strip a string of all symbols and characters other than alphanumeric letters and numbers from your file or database. This code will delete any non-alphanumeric characters specified between the brackets, and then output/return the clean version.</p>
<h2>The code</h2>
<p><code><span style="color: #000000;"><br />
<span style="color: #0000bb;">&lt;?php</span></span></code></p>
<p>$string <span style="color: #007700;">= </span><span style="color: #dd0000;">&#8220;Here! is some text, and numbers 12345, and symbols !£$%^&amp;&#8221;</span><span style="color: #007700;">;</span></p>
<p><span style="color: #0000bb;">$new_string </span><span style="color: #007700;">= </span><span style="color: #0000bb;">preg_replace</span><span style="color: #007700;">(</span><span style="color: #dd0000;">&#8220;/[^a-zA-Z0-9\s]/&#8221;</span><span style="color: #007700;">, </span><span style="color: #dd0000;">&#8220;&#8221;</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$string</span><span style="color: #007700;">);</span></p>
<p>echo <span style="color: #0000bb;">$new_string</span></p>
<p>?&gt;</p>
<p>The code should return this:</p>
<p><code><span style="color: #000000;"><span style="color: #969696;">Here is some text and numbers 12345 and symbols</span></span></code></p>
<p>One more thing. If you don&#8217;t like to keep the blank white space in your text just reformat the preg_replace by removing the &#8220;\s&#8221; whitespace character types. This is good for use with user names and passwords. The code would now look something like this:</p>
<p><code> <span style="color: #000000;"><span style="color: #969696;">Hereissometextandnumbers12345andsymbols</span></span></code></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://newsourcemedia.com/blog/sort-directory-listings/" rel="bookmark">Sort Directory Listings</a></li><li><a href="http://newsourcemedia.com/blog/breaking-out-of-frames/" rel="bookmark">Breaking out of frames</a></li><li><a href="http://newsourcemedia.com/blog/php-email-form-easy/" rel="bookmark">PHP Email Form Easy</a></li><li><a href="http://newsourcemedia.com/blog/php-lesson-2-add-comments/" rel="bookmark">PHP Lesson 2 - Add Comments</a></li><li><a href="http://newsourcemedia.com/blog/copyright-and-trademark-in-html-code/" rel="bookmark">Copyright and Trademark in html code</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-remove-non-alphanumeric-characters/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->