<?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>Kerkness.ca &#187; php-to-flex</title>
	<atom:link href="http://www.kerkness.ca/tagged/php-to-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerkness.ca</link>
	<description>flexing my kerkness, among other things</description>
	<lastBuildDate>Wed, 14 Oct 2009 15:12:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP trim() function in Actionscript for Flex</title>
		<link>http://www.kerkness.ca/php-trim-function-in-actionscript-for-flex/</link>
		<comments>http://www.kerkness.ca/php-trim-function-in-actionscript-for-flex/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 23:23:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=55</guid>
		<description><![CDATA[Here is PHP&#8217;s trim() function reproduced in Actionscript for use in a Flex application
public function trim(str:String):String
{
  for(var i:Number = 0; str.charCodeAt(i) &#60; 33; i++);
  for(var j:Number = str.length-1; str.charCodeAt(j) &#60; 33; j--);
  return str.substring(i, j+1);
}
UPDATE:  Thanks to Almog Kurtser, I now know that Flex has a utility to handle trimming strings. [...]]]></description>
			<content:encoded><![CDATA[<p>Here is PHP&#8217;s trim() function reproduced in Actionscript for use in a Flex application</p>
<pre name="code" class="js">public function trim(str:String):String
{
  for(var i:Number = 0; str.charCodeAt(i) &lt; 33; i++);
  for(var j:Number = str.length-1; str.charCodeAt(j) &lt; 33; j--);
  return str.substring(i, j+1);
}</pre>
<p>UPDATE:  Thanks to Almog Kurtser, I now know that Flex has a utility to handle trimming strings.  Here is an alternative example</p>
<pre name="code" class="js">import mx.utils.StringUtil;
public function trim(str:String):String
{
  return StringUtil.trim(str);
}</pre>
<p>Of course it is redundant to actually create a function called trim just to call the method StringUtil.trim()  but you get the idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-trim-function-in-actionscript-for-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP explode() function in Actionscript for Flex</title>
		<link>http://www.kerkness.ca/php-explode-function-in-actionscript-for-flex/</link>
		<comments>http://www.kerkness.ca/php-explode-function-in-actionscript-for-flex/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 00:40:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=39</guid>
		<description><![CDATA[If you&#8217;re a long time PHP programmer who has made the leap to building Flex based RIA applications in Flex you are probably asking yourself from time to time &#8220;how do I do a xxxxx function in actionscript&#8221;.   Well if you were recently wondering this about the PHP explode() function, here&#8217;s your answer.
public [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a long time PHP programmer who has made the leap to building Flex based RIA applications in Flex you are probably asking yourself from time to time &#8220;how do I do a xxxxx function in actionscript&#8221;.   Well if you were recently wondering this about the PHP explode() function, here&#8217;s your answer.</p>
<pre>public function explode( delimiter:String, str:String ):Array
{
   return str.split( delimiter );
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-explode-function-in-actionscript-for-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Use a remote HTTPService in Flex with a PHP Proxy</title>
		<link>http://www.kerkness.ca/use-a-remote-httpservice-in-flex-with-a-php-proxy/</link>
		<comments>http://www.kerkness.ca/use-a-remote-httpservice-in-flex-with-a-php-proxy/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 11:43:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=19</guid>
		<description><![CDATA[One way to get around the hassle of a common security error when trying to call a HTTPService running on a different domain than your Flex application is to use a simple and local PHP script as a proxy to call the HTTPService for you. Perhaps not a solution you would want to use if [...]]]></description>
			<content:encoded><![CDATA[<p>One way to get around the hassle of a common security error when trying to call a HTTPService running on a different domain than your Flex application is to use a simple and local PHP script as a proxy to call the HTTPService for you. Perhaps not a solution you would want to use if you need to load massive piles of data but in most cases it works just fine and takes seconds to set up.</p>
<p><span style="font-weight: bold;">proxy.php</span>
<pre>$content = file_get_contents(str_replace(' ','%20',$_GET['url']));if ($content !== false) {   echo($content);} else {  // there was an error}</pre>
<p><span style="font-weight: bold;">HTTPService in MXML</span>
<pre>&lt;mx:HTTPService id="myService"url="http://www.localdomain.com/proxy.php?url=http://www.remote.com/api"/&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/use-a-remote-httpservice-in-flex-with-a-php-proxy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP in_array() function in ActionScript for Flex</title>
		<link>http://www.kerkness.ca/php-in_array-function-in-actionscript-for-flex/</link>
		<comments>http://www.kerkness.ca/php-in_array-function-in-actionscript-for-flex/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 02:10:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=17</guid>
		<description><![CDATA[Another common PHP function is in_array() used to determine if a value exsists in an array. Here is the function recreated in actionscript for flex.
public function in_array( needle:*, haystack:Array ):Boolean{   var itemIndex:int = haystack.indexOf( needle );   return ( itemIndex < 0 ) ? false : true;}
]]></description>
			<content:encoded><![CDATA[<p>Another common PHP function is in_array() used to determine if a value exsists in an array. Here is the function recreated in actionscript for flex.
<pre>public function in_array( needle:*, haystack:Array ):Boolean{   var itemIndex:int = haystack.indexOf( needle );   return ( itemIndex < 0 ) ? false : true;}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-in_array-function-in-actionscript-for-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ucfirst() and ucwords() in Flex</title>
		<link>http://www.kerkness.ca/php-ucfirst-and-ucwords-in-flex/</link>
		<comments>http://www.kerkness.ca/php-ucfirst-and-ucwords-in-flex/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 03:17:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=12</guid>
		<description><![CDATA[Another common PHP function converted to ActionScript for use in a Flex application.
public function ucfirst( str:String ):String{  return str.substr(0,1).toUpperCase()+str.substr(1);}public function ucwords( str:String ):String{  var myArr:Array = str.split(' ');  for (var i:int in myArr ) {     myArr[i] = ucfirst( myArr[i] );  }  return myArr.join(' ');}
]]></description>
			<content:encoded><![CDATA[<p>Another common PHP function converted to ActionScript for use in a Flex application.
<pre>public function ucfirst( str:String ):String{  return str.substr(0,1).toUpperCase()+str.substr(1);}public function ucwords( str:String ):String{  var myArr:Array = str.split(' ');  for (var i:int in myArr ) {     myArr[i] = ucfirst( myArr[i] );  }  return myArr.join(' ');}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-ucfirst-and-ucwords-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP strtoupper() and strtolower() in Flex</title>
		<link>http://www.kerkness.ca/php-strtoupper-and-strtolower-in-flex/</link>
		<comments>http://www.kerkness.ca/php-strtoupper-and-strtolower-in-flex/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 03:07:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=11</guid>
		<description><![CDATA[Having been a PHP programmer for many years and only now in the last month started to learn Flex and ActionScript I find I&#8217;m always looking for ways to get something done in ActionScript which I know how to do in PHP.  These are pretty straight forward and simple functions but sometimes it&#8217;s nice [...]]]></description>
			<content:encoded><![CDATA[<p>Having been a PHP programmer for many years and only now in the last month started to learn Flex and ActionScript I find I&#8217;m always looking for ways to get something done in ActionScript which I know how to do in PHP.  These are pretty straight forward and simple functions but sometimes it&#8217;s nice to have a reference.</p>
<p><span style="font-weight: bold;">PHP strtoupper( $string ) and strtolower( $string ) in Flex</span>
<pre>public function strtoupper( str:String ):void{ return str.toUpperCase();}   public function strtolower( str:String ):void{ return str.toLowerCase();}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-strtoupper-and-strtolower-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Replace Function in Flex</title>
		<link>http://www.kerkness.ca/string-replace-function-in-flex/</link>
		<comments>http://www.kerkness.ca/string-replace-function-in-flex/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 03:20:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[php-to-flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=8</guid>
		<description><![CDATA[I&#8217;m not sure if this is a redundant function or not.  I know that Flex String objects have a replace() method but as far as I can tell this only replaces the first match and not every match in a string.
Here is an actionscript function for flex which works the same as the php [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if this is a redundant function or not.  I know that Flex String objects have a replace() method but as far as I can tell this only replaces the first match and not every match in a string.</p>
<p>Here is an actionscript function for flex which works the same as the php str_replace() function.</p>
<p><span style="font-weight: bold;">str_replace( needle, replacement, haystack ) in ActionScript</span>
<pre>public function str_replace(needle:String, replacement:String, haystack:String):String{  var strArr:Array = haystack.split(needle);  return strArr.join(replacement);}</pre>
<p>If this is a pointless function and there is an easier way to accomplish this built into flex I would love to hear about it. I looked over the language reference documents and couldn&#8217;t find something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/string-replace-function-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
