<?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; string</title>
	<atom:link href="http://newsourcemedia.com/blog/tag/string/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Mon, 07 May 2012 01:26:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP Validation Numbers Only From</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/</link>
		<comments>http://newsourcemedia.com/blog/php-validation-numbers-only-from/#comments</comments>
		<pubDate>Tue, 30 Nov 1999 06:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Forms]]></category>
		<category><![CDATA[Math and Numbers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[credit card]]></category>
		<category><![CDATA[digit]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[phone number]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[zip code]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/</guid>
		<description><![CDATA[How to check for number values only and block or convert letter strings to integers. Question: How to validate number values to and block all letters and symbol in a form. Answer: You can check the value or convert the &#8230; <a href="http://newsourcemedia.com/blog/php-validation-numbers-only-from/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to check for number values only and block or convert letter strings to integers.
<span id="more-170"></span>

<strong>Question:</strong> How to validate number values to and block all letters and symbol in a form.

<strong>Answer:</strong> You can check the value or convert the value to an integer (number).

1) Check a value using is_int() to finds whether the given variable is an integer

<code>&lt;?
if(is_int($variable))
echo "Pass test";
else
echo "Please use only numbers";
?&gt; </code>

2) Note: To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric().

<code>&lt;?
if(is_numeric($variable))
echo "Pass test";
else
echo "Please use only numbers";
?&gt; </code>

3) Convert the value to an integer (number) using settype.

<code>&lt;?php
$foo = "5bar"; // string
$bar = true; // boolean</code>

settype($foo, "integer"); // $foo is now 5 (integer)
settype($bar, "string"); // $bar is now "1" (string)
?&gt;

or you can use int to do the trick.

<code>
&lt;?
$int=593; // $int is a integer
$int.=""; // $int is now a string
?&gt;
</code>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-validation-numbers-only-from/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Formatting Numbers in Flash for Commas</title>
		<link>http://newsourcemedia.com/blog/formatting-numbers-in-flash-for-commas/</link>
		<comments>http://newsourcemedia.com/blog/formatting-numbers-in-flash-for-commas/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[commas]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2007/09/14/formatting-numbers-in-flash-for-commas/</guid>
		<description><![CDATA[Here is how to use actionscript to format a number in Flash with commas per thousands. my_number = "12587654325"; // array in sections of 3 to separate with commas trace(my_number); var dollar_array:Array = new Array(); var start:Number; var end:Number = &#8230; <a href="http://newsourcemedia.com/blog/formatting-numbers-in-flash-for-commas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Here is how to use actionscript to format a number in Flash with commas per thousands.
<span id="more-161"></span>

my_number = "12587654325";

// array in sections of 3 to separate with commas
trace(my_number);
var dollar_array:Array = new Array();
var start:Number;
var end:Number = my_number.length;
trace(my_number.length);
while (end &gt; 0) {
trace(end);
start = Math.max(end - 3, 0);
dollar_array.unshift(my_number.slice(start, end));
end = start;
}

// assign a comma delimited value from dollar_array
my_number = dollar_array.join(",");
trace(my_number);]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/formatting-numbers-in-flash-for-commas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Split() by newline and return using PHP</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/</link>
		<comments>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/#comments</comments>
		<pubDate>Sat, 27 Mar 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[break]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[devide]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[split text]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/</guid>
		<description><![CDATA[How to create an array by using the split() function on multiple newlines and returns. Introduction: I was having a problem trying to split a string of multiple lines from an online form using the flowing code: This was producing &#8230; <a href="http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to create an array by using the split() function on multiple newlines and returns.
<span id="more-203"></span>

Introduction:

I was having a problem trying to split a string of multiple lines from an online form using the flowing code:

<pre lang="php"><?php
   $arry_names = split("\n", $names);
?></pre>


This was producing an unexpected line break. I searched the web to see if anyone had the same problem and found that I needed to check for "returns" (\r) also. So now when I'm splitting data by lines, I use the following code:

<pre lang="php"><?php
   $arry_names = split("", $names);
?></pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/feed/</wfw:commentRss>
		<slash:comments>6</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! -->
