Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/05/2011, 15:10
perucho_88
 
Fecha de Ingreso: abril-2011
Mensajes: 12
Antigüedad: 13 años
Puntos: 0
Respuesta: Fatal error: Cannot redeclare explodei()

Cita:
Iniciado por GatorV Ver Mensaje
¿Tienes ese código dentro de algún loop o algo similar?
gracias por la ayuda... veamos antes del codigo que ya he puesto no hay ningun for como para que hayan loops (ni nada de codigo... solo los datos del bs, user,etc)... en toda el codigo hay dos for (de inc/config.php)... uno es el que ya ensene...
para mayor claridad dejo todo el codigo...

Código:
44/* EXTRA FUNCTIONS */
45function explodei($separator, $string, $limit = false )
{
   $len = strlen($separator);
   for ( $i = 0; ; $i++ )
   {
       if ( ($pos = stripos( $string, $separator )) === false || ($limit !== false && $i > $limit - 2 ) )
       {
           $result[$i] = $string;
           break;
       }
       $result[$i] = substr( $string, 0, $pos );
       $string = substr( $string, $pos + $len );
   }
   return $result;
} 

function str2int($string, $concat = true) {
    $length = strlen($string);   
    for ($i = 0, $int = '', $concat_flag = true; $i < $length; $i++) {
        if (is_numeric($string[$i]) && $concat_flag) {
            $int .= $string[$i];
        } elseif(!$concat && $concat_flag && strlen($int) > 0) {
            $concat_flag = false;
        }       
    }
   
    return (int) $int;
}

function highlight($text, $words) {
    $words = trim($words);
    $wordsArray = explode(' ', $words);
    foreach($wordsArray as $word) {
        if(strlen(trim($word)) != 0)
            $text = eregi_replace($word, '<b>\\0</b>', $text);
    }
    return $text;
82} 
83?>