<?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>Комментарии: Хелпер Arr</title>
	<atom:link href="http://kohanaframework.su/helpers/helpers_arr/feed" rel="self" type="application/rss+xml" />
	<link>http://kohanaframework.su</link>
	<description>Документация и обучение фреймворку Kohana v3.2</description>
	<lastBuildDate>Tue, 04 Aug 2015 19:12:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Автор: xoptov</title>
		<link>http://kohanaframework.su/helpers/helpers_arr/comment-page-1#comment-1597</link>
		<dc:creator>xoptov</dc:creator>
		<pubDate>Fri, 29 Mar 2013 19:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=1103#comment-1597</guid>
		<description>Интересно от Вас услышать чем массив отличается от объекта в своем внутреннем представлении? Как вы считаете может это одно и тоже?</description>
		<content:encoded><![CDATA[<p>Интересно от Вас услышать чем массив отличается от объекта в своем внутреннем представлении? Как вы считаете может это одно и тоже?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: xoptov</title>
		<link>http://kohanaframework.su/helpers/helpers_arr/comment-page-1#comment-1596</link>
		<dc:creator>xoptov</dc:creator>
		<pubDate>Fri, 29 Mar 2013 19:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=1103#comment-1596</guid>
		<description>Поддерживаю!</description>
		<content:encoded><![CDATA[<p>Поддерживаю!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: root</title>
		<link>http://kohanaframework.su/helpers/helpers_arr/comment-page-1#comment-1179</link>
		<dc:creator>root</dc:creator>
		<pubDate>Mon, 20 Aug 2012 12:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=1103#comment-1179</guid>
		<description>вся эта мега функция 

  /**
    * Create array from object
    * 
    * @param   mixed   $obj  Database MySQL Result Object
    * @access  public
    * @return  array         Associative array
    */
   public static function get_array($obj)
   {
     $array = array();
     foreach ($obj as $a =&gt; $b)
       $array[$a] = $b;

     return $array;
   }

заменяется одной строчкой $array = (array) $obj;
учите основы, что бы не писать всякий бред</description>
		<content:encoded><![CDATA[<p>вся эта мега функция </p>
<p>  /**<br />
    * Create array from object<br />
    *<br />
    * @param   mixed   $obj  Database MySQL Result Object<br />
    * @access  public<br />
    * @return  array         Associative array<br />
    */<br />
   public static function get_array($obj)<br />
   {<br />
     $array = array();<br />
     foreach ($obj as $a =&gt; $b)<br />
       $array[$a] = $b;</p>
<p>     return $array;<br />
   }</p>
<p>заменяется одной строчкой $array = (array) $obj;<br />
учите основы, что бы не писать всякий бред</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Sergey</title>
		<link>http://kohanaframework.su/helpers/helpers_arr/comment-page-1#comment-1116</link>
		<dc:creator>Sergey</dc:creator>
		<pubDate>Tue, 31 Jul 2012 09:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=1103#comment-1116</guid>
		<description>:)

http://codepaste.ru/11386/</description>
		<content:encoded><![CDATA[<p> <img src='http://kohanaframework.su/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://codepaste.ru/11386/" rel="nofollow">http://codepaste.ru/11386/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Денис Васильевич</title>
		<link>http://kohanaframework.su/helpers/helpers_arr/comment-page-1#comment-542</link>
		<dc:creator>Денис Васильевич</dc:creator>
		<pubDate>Fri, 02 Mar 2012 09:43:13 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=1103#comment-542</guid>
		<description>Вообщем похоже на стандартный array_fill, только для ассоциативных массивов. Я на форуме позже напишу с нормальными кавычками. Если вы не возражаете.
Спасибо.</description>
		<content:encoded><![CDATA[<p>Вообщем похоже на стандартный array_fill, только для ассоциативных массивов. Я на форуме позже напишу с нормальными кавычками. Если вы не возражаете.<br />
Спасибо.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: root</title>
		<link>http://kohanaframework.su/helpers/helpers_arr/comment-page-1#comment-540</link>
		<dc:creator>root</dc:creator>
		<pubDate>Thu, 01 Mar 2012 22:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=1103#comment-540</guid>
		<description>расширил этот класс методом который заполняет массив указаным значением.

    public static function fill(array $array, $default = NULL)
    {
        foreach ($array as $key =&gt; $val)
        {
            if (is_array($val))
            {
                $array[$key] = Arr::fill($array[$key], $default);
            }
            else
            {
                $array[$key] = $default;
            }
        }
        
        return $array;
    }
    

работает так

$arr = Arr::fill(array (&#039;el1&#039; =&gt; &#039;&#039;, &#039;el2&#039; =&gt; &#039;&#039;), &#039;test&#039;)

$arr =&gt; (&#039;el1&#039; =&gt; &#039;test&#039;, &#039;el2&#039; =&gt; &#039;test&#039;)</description>
		<content:encoded><![CDATA[<p>расширил этот класс методом который заполняет массив указаным значением.</p>
<p>    public static function fill(array $array, $default = NULL)<br />
    {<br />
        foreach ($array as $key =&gt; $val)<br />
        {<br />
            if (is_array($val))<br />
            {<br />
                $array[$key] = Arr::fill($array[$key], $default);<br />
            }<br />
            else<br />
            {<br />
                $array[$key] = $default;<br />
            }<br />
        }</p>
<p>        return $array;<br />
    }</p>
<p>работает так</p>
<p>$arr = Arr::fill(array (&#8216;el1&#8242; =&gt; &#187;, &#8216;el2&#8242; =&gt; &#187;), &#8216;test&#8217;)</p>
<p>$arr =&gt; (&#8216;el1&#8242; =&gt; &#8216;test&#8217;, &#8216;el2&#8242; =&gt; &#8216;test&#8217;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
