Ejemplo n.º 1
0
 /**
  * Convert numeric key element to boolean value element.
  *
  * By string_to_array,
  * <code>$string = 'foo,bar' => array(0=>'foo',1=>'bar').</code>
  * Want options as, 
  * <code>$string = 'foo,bar' => array('foo'=>true,'bar'=>true).</code>
  * Perform this conversion.
  *
  * @access private
  * @static
  * @param array $array
  * @return array
  * @see boolean_to_numeric
  * @version $Id: v 1.0 2008-06-07 11:14:46 sonots $
  * @since   v 1.4
  */
 function numeric_to_boolean($array)
 {
     $options = array();
     foreach ($array as $key => $val) {
         if (is_numeric($key)) {
             $options[$val] = true;
         } elseif (is_array($val)) {
             $options[$key] = PluginSonotsOption::numeric_to_boolean($val);
         } else {
             $options[$key] = $val;
         }
     }
     return $options;
 }