<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Talk In Code</title>
	<atom:link href="http://www.talkincode.com/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://www.talkincode.com</link>
	<description>Code tips, snippets and resources.</description>
	<lastBuildDate>Wed, 04 May 2011 11:50:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>Comment on Cut A String To A Specified Length With PHP by David</title>
		<link>http://www.talkincode.com/cut-a-string-to-a-specified-length-with-php-135.html/comment-page-1#comment-1902</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 04 May 2011 11:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=135#comment-1902</guid>
		<description>Very usefull. If you don&#039;t want trailing dots after a string that is shorter than the maximum length specified, use this slightly altered version:

function substrwords($text,$maxchar,$end=&#039;...&#039;){
 if(strlen($text)&gt;$maxchar){
  $words=explode(&quot; &quot;,$text);
  $output = &#039;&#039;;
  $i=0;
  while(1){
   $length = (strlen($output)+strlen($words[$i]));
   if($length&gt;$maxchar){
	$output = $output.$end;
    break;
   }else{
    $output = $output.&quot; &quot;.$words[$i];
    ++$i;
   };
  };
 }else{
  $output = $text;
 }
 return $output;
}</description>
		<content:encoded><![CDATA[<p>Very usefull. If you don&#8217;t want trailing dots after a string that is shorter than the maximum length specified, use this slightly altered version:</p>
<p>function substrwords($text,$maxchar,$end=&#8217;&#8230;&#8217;){<br />
 if(strlen($text)&gt;$maxchar){<br />
  $words=explode(&#8221; &#8220;,$text);<br />
  $output = &#8221;;<br />
  $i=0;<br />
  while(1){<br />
   $length = (strlen($output)+strlen($words[$i]));<br />
   if($length&gt;$maxchar){<br />
	$output = $output.$end;<br />
    break;<br />
   }else{<br />
    $output = $output.&#8221; &#8220;.$words[$i];<br />
    ++$i;<br />
   };<br />
  };<br />
 }else{<br />
  $output = $text;<br />
 }<br />
 return $output;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Random Number Range In MySQL by Jake Sully</title>
		<link>http://www.talkincode.com/random-number-range-in-mysql-121.html/comment-page-1#comment-1901</link>
		<dc:creator>Jake Sully</dc:creator>
		<pubDate>Sat, 30 Apr 2011 13:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=121#comment-1901</guid>
		<description>Edit: 

In the last sentence I meant that if the lower range is 0 and the upper range is 1 I suspect it will not work as well.</description>
		<content:encoded><![CDATA[<p>Edit: </p>
<p>In the last sentence I meant that if the lower range is 0 and the upper range is 1 I suspect it will not work as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Random Number Range In MySQL by Jake Sully</title>
		<link>http://www.talkincode.com/random-number-range-in-mysql-121.html/comment-page-1#comment-1900</link>
		<dc:creator>Jake Sully</dc:creator>
		<pubDate>Sat, 30 Apr 2011 13:37:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=121#comment-1900</guid>
		<description>This random number range statement will not work when the lower end of the range is any negative number and the upper range is 1. It will always return the lower range. 

I suspect other values with a negative number will not work as well.</description>
		<content:encoded><![CDATA[<p>This random number range statement will not work when the lower end of the range is any negative number and the upper range is 1. It will always return the lower range. </p>
<p>I suspect other values with a negative number will not work as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on HTML Checkbox To PHP Array by Steve</title>
		<link>http://www.talkincode.com/html-checkbox-to-php-array-118.html/comment-page-1#comment-1872</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 06 Apr 2011 17:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=118#comment-1872</guid>
		<description>I am 4 months new to PHP! So please be gentle with me. : )

I have an input form that contains check-boxes(it works and posts array to database correctly!) I have an update form that contains the same check-boxes (it updates and posts array to database correctly BUT IT DOESN&#039;T CORRECTLY DISPLAY database info in the checkboxes!)

The Problem is: I cannot get the update form to correctly display &quot;the check-box array&quot; from the database&quot; It only displays the LAST unit in each array!?!?!?!?!?

Here is my php code to pull the array from the database in a while loop (while loop works perfect and I can echo to the top of the page correctly but I want it in my html form below the php code in the HTML):

$childarr = explode(&quot;,&quot;, $row[&quot;children_pref&quot;]);
for($i=0; $i&lt;sizeof($childarr); $i++) {
$children_pref = mysql_real_escape_string($childarr[$i]); }

I have MANY of these but will just show you one...

This is my html code for the form...

&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;0&quot; &gt;
None
&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;1&quot; &gt; 1
&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;2&quot; &gt; 2
&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;3&quot; &gt; 3
&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;4&quot; &gt; 4
&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;5&quot; &gt; 5
&lt;input type=&quot;checkbox&quot; name=&quot;children_pref[]&quot; value=&quot;6&quot; &gt; 6 or more

Any insight would be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>I am 4 months new to PHP! So please be gentle with me. : )</p>
<p>I have an input form that contains check-boxes(it works and posts array to database correctly!) I have an update form that contains the same check-boxes (it updates and posts array to database correctly BUT IT DOESN&#8217;T CORRECTLY DISPLAY database info in the checkboxes!)</p>
<p>The Problem is: I cannot get the update form to correctly display &#8220;the check-box array&#8221; from the database&#8221; It only displays the LAST unit in each array!?!?!?!?!?</p>
<p>Here is my php code to pull the array from the database in a while loop (while loop works perfect and I can echo to the top of the page correctly but I want it in my html form below the php code in the HTML):</p>
<p>$childarr = explode(&#8220;,&#8221;, $row["children_pref"]);<br />
for($i=0; $i&lt;sizeof($childarr); $i++) {<br />
$children_pref = mysql_real_escape_string($childarr[$i]); }</p>
<p>I have MANY of these but will just show you one&#8230;</p>
<p>This is my html code for the form&#8230;</p>
<p>&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;0&#8243; &gt;<br />
None<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;1&#8243; &gt; 1<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;2&#8243; &gt; 2<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;3&#8243; &gt; 3<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;4&#8243; &gt; 4<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;5&#8243; &gt; 5<br />
&lt;input type=&#8221;checkbox&#8221; name=&#8221;children_pref[]&#8221; value=&#8221;6&#8243; &gt; 6 or more</p>
<p>Any insight would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Search A Table With JavaScript by asipo</title>
		<link>http://www.talkincode.com/search-a-table-with-javascript-939.html/comment-page-1#comment-1819</link>
		<dc:creator>asipo</dc:creator>
		<pubDate>Fri, 04 Mar 2011 10:18:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=939#comment-1819</guid>
		<description>I just improve slightly of the code
The function doSearch will require two parameter which is tableId and queryId

    function doSearch( tableId, queryId) {
        var q       = document.getElementById(queryId);
        var v       = q.value.toLowerCase();

        var t       = document.getElementById(tableId);
        var rows    = t.getElementsByTagName(&quot;tr&quot;);
        var on      = 0;

        ...rest will be the same</description>
		<content:encoded><![CDATA[<p>I just improve slightly of the code<br />
The function doSearch will require two parameter which is tableId and queryId</p>
<p>    function doSearch( tableId, queryId) {<br />
        var q       = document.getElementById(queryId);<br />
        var v       = q.value.toLowerCase();</p>
<p>        var t       = document.getElementById(tableId);<br />
        var rows    = t.getElementsByTagName(&#8220;tr&#8221;);<br />
        var on      = 0;</p>
<p>        &#8230;rest will be the same</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Filter FILTER_VALIDATE_URL Limitations by Paul</title>
		<link>http://www.talkincode.com/php-filter-filter_validate_url-limitations-124.html/comment-page-1#comment-1814</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Fri, 25 Feb 2011 21:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=124#comment-1814</guid>
		<description>Maybe PHP fixed filter_var($url,FILTER_VALIDATE_URL) because it&#039;s works perfect for me. You wrote,
+++
$url = &#039;http://.com&#039;; // true
$url = &#039;http://...&#039;; // true
+++
but both of those return false for me. Try it again with the latest PHP 5.2+. It works great.</description>
		<content:encoded><![CDATA[<p>Maybe PHP fixed filter_var($url,FILTER_VALIDATE_URL) because it&#8217;s works perfect for me. You wrote,<br />
+++<br />
$url = &#8216;<a href="http://.com&#039;" rel="nofollow">http://.com&#039;</a>; // true<br />
$url = &#8216;<a href="http://...&#039;" rel="nofollow">http://&#8230;&#039;</a>; // true<br />
+++<br />
but both of those return false for me. Try it again with the latest PHP 5.2+. It works great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Shuffle An Array In PHP by Marlon Soto</title>
		<link>http://www.talkincode.com/shuffle-an-array-in-php-47.html/comment-page-1#comment-1807</link>
		<dc:creator>Marlon Soto</dc:creator>
		<pubDate>Thu, 03 Feb 2011 14:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/shuffle-an-array-in-php-47.html#comment-1807</guid>
		<description>Hi, I found your page with this php array searching with Google. I am writing you to see if you can help me. I have one (1) topsite list with banners rotating at the center, left and right. The problem is that I&#039;m developing a second topsite with the same structure, same code, same array, but I cannot get rotate banners, there is no way to make them rotate. The array I am using is very similar to yours:

//randomly shuffle the array keeping the relation between keys and values
function shuffle_me($shuffle_me){
  $randomized_keys = array_rand($shuffle_me, count($shuffle_me));
  foreach($randomized_keys as $current_key) {
    $shuffled_me[$current_key] = $shuffle_me[$current_key];
  }
  return $shuffled_me;
}
$center_banners=shuffle_me($center_banners);
$center_banners=array_slice($center_banners, 0, 20);

$left_banners=shuffle_me($left_banners);
$right_banners=shuffle_me($right_banners);
?&gt;

Could you help me? I am really very little expertise in this area, I do not understand why the script works perfectly in one topsite and in another topsite, which is a clone of the first one, does not work. What determines that the banners rotate in addition to the script?

Thanks for your help
Marlon</description>
		<content:encoded><![CDATA[<p>Hi, I found your page with this php array searching with Google. I am writing you to see if you can help me. I have one (1) topsite list with banners rotating at the center, left and right. The problem is that I&#8217;m developing a second topsite with the same structure, same code, same array, but I cannot get rotate banners, there is no way to make them rotate. The array I am using is very similar to yours:</p>
<p>//randomly shuffle the array keeping the relation between keys and values<br />
function shuffle_me($shuffle_me){<br />
  $randomized_keys = array_rand($shuffle_me, count($shuffle_me));<br />
  foreach($randomized_keys as $current_key) {<br />
    $shuffled_me[$current_key] = $shuffle_me[$current_key];<br />
  }<br />
  return $shuffled_me;<br />
}<br />
$center_banners=shuffle_me($center_banners);<br />
$center_banners=array_slice($center_banners, 0, 20);</p>
<p>$left_banners=shuffle_me($left_banners);<br />
$right_banners=shuffle_me($right_banners);<br />
?&gt;</p>
<p>Could you help me? I am really very little expertise in this area, I do not understand why the script works perfectly in one topsite and in another topsite, which is a clone of the first one, does not work. What determines that the banners rotate in addition to the script?</p>
<p>Thanks for your help<br />
Marlon</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Enable Custom Field Search In WordPress by Rotten Elf</title>
		<link>http://www.talkincode.com/enable-custom-field-search-in-wordpress-49.html/comment-page-1#comment-1805</link>
		<dc:creator>Rotten Elf</dc:creator>
		<pubDate>Mon, 24 Jan 2011 21:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/enable-custom-field-search-in-wordpress-49.html#comment-1805</guid>
		<description>Just when I thought I finally found the uber-solution to my problem....is there any way we can get this fully updated for the latest wordpress versions?  I&#039;m in dire need of a custom field search code that actually works.....please.   :)</description>
		<content:encoded><![CDATA[<p>Just when I thought I finally found the uber-solution to my problem&#8230;.is there any way we can get this fully updated for the latest wordpress versions?  I&#8217;m in dire need of a custom field search code that actually works&#8230;..please.   <img src='http://www.talkincode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting An Excerpt Of Text With PHP by Jon L</title>
		<link>http://www.talkincode.com/getting-an-excerpt-of-text-with-php-181.html/comment-page-1#comment-1802</link>
		<dc:creator>Jon L</dc:creator>
		<pubDate>Wed, 19 Jan 2011 17:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=181#comment-1802</guid>
		<description>I just realized CakePHP already has a function for this so I won&#039;t be creating one after all.</description>
		<content:encoded><![CDATA[<p>I just realized CakePHP already has a function for this so I won&#8217;t be creating one after all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting An Excerpt Of Text With PHP by Jon L</title>
		<link>http://www.talkincode.com/getting-an-excerpt-of-text-with-php-181.html/comment-page-1#comment-1801</link>
		<dc:creator>Jon L</dc:creator>
		<pubDate>Wed, 19 Jan 2011 16:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.talkincode.com/?p=181#comment-1801</guid>
		<description>Also thank you for saving me some work. I used your function to create a helper for CakePHP. I will write an article about it and send you the link.</description>
		<content:encoded><![CDATA[<p>Also thank you for saving me some work. I used your function to create a helper for CakePHP. I will write an article about it and send you the link.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

