<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - Pro PHP</title>
		<link>http://p2p.wrox.com</link>
		<description>Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 18:56:06 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - Pro PHP</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>Formatting phone number</title>
			<link>http://p2p.wrox.com/pro-php/76866-formatting-phone-number.html</link>
			<pubDate>Mon, 02 Nov 2009 17:02:58 GMT</pubDate>
			<description>Hello,

I am trying to format US phone numbers to look like this (###) ###-#### and the code that I used is: 
Code:
---------
function...</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I am trying to format US phone numbers to look like this (###) ###-#### and the code that I used is: <div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">function format_phone($phone_1)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $phone = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $phone_1);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(strlen($phone_1) == 7)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return preg_replace(&quot;/([0-9]{3})([0-9]{4})/&quot;, &quot;$1-$2&quot;, $phone_1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; elseif(strlen($phone_1) == 10)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return preg_replace(&quot;/([0-9]{3})([0-9]{3})([0-9]{4})/&quot;, &quot;($1) $2-$3&quot;, $phone_1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $phone_1;<br />
}</code><hr />
</div>This was inputted into the VirtuemartOrdersReport.php file and it does not seem to work.</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/pro-php-96/">Pro PHP</category>
			<dc:creator>dyung2</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/pro-php/76866-formatting-phone-number.html</guid>
		</item>
	</channel>
</rss>
