RE: Problemas con las igualdades

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tango:

---------------------------------------------

En español:
¿Usted habla inglés? Mucha gente en esta lista habla solamente inglés y ella puede no entender su pregunta. Estoy utilizando un software de la traducción (Babelfish) para intentar ayudar.

Recomiendo el usar de la función del file() para leer la línea del archivo uno a la vez y para analizar la línea para ACTIVADO y DESACTIVADO. Puede ser que sea más fácil y puede trabajar mejor.
http://us2.php.net/manual/es/function.file.php

Utilice quizá la función del trim() también.

Siéntase por favor libre escribirme si esta solución no trabaja. Puedo intentar ayudar. ¡Buena suerte!

---------------------------------------------

In English:
Do you speak english?  Many people on this list only speak english and they may not understand your question.   I am using a translation software (Babelfish) to try to help.

I recommend using the file() function to read the file one line at a time and parse the line for ACTIVADO and DESACTIVADO.  It might be easier and may work better.
http://us2.php.net/manual/es/function.file.php

Maybe use the trim() function also.

Please feel free to write to me if this solution does not work.  I can try to help.

Good luck!


-TG


> -----Original Message-----
> From: T4NG0 [mailto:tango@xxxxxxxxxxxxxxxx] 
> Sent: Monday, November 29, 2004 7:39 PM
> To: php-windows@xxxxxxxxxxxxx
> Subject:  Problemas con las igualdades
> 
> 
> Listeros:
> 
> estoy tratando de establecer una igualdad y no logro comprender el 
> funcionamiento, el código es el siguiente.
> 
> dado X archivos en mi directorio cuyo contenido puerde ser 
> "ACTIVADO", 
> "DESACTIVADO" o "NULO".
> 
> yo debo determinar el contenido de ellos.
> el problema es que yo logro ver bien el contenido del archivo 
> y lo puedo 
> mostrar sin problemas (esa parte del script no la pastié) 
> pero lo que no 
> puedo hacer es determinar el contenido del archivo (la linea 
> IF $leer == 
> "ACTIVADO" me da o siempre falso o siempre verdadero pero 
> nunca logro obtener 
> un resultado coherente... ni con = ni con == ni con ===)
> 
> alguna idea gente ??
> 
> supongo que dada la hora mis neuronas ya no quieren funcionar 
> y no veo cual es 
> la pavada que me esta deteniendo...
> 
> 
> for ($x = 40; $x< 154; $x++)
> {
>   $fp=@fopen("./ws$x",'r');
>   $leer = @fread($fp, 8192);
> 
>   settype($leer, "string");
>  
>   if ($leer=="ACTIVADO")
>   {
>     echo "ACTIVADO";
>   } else {
>     echo "DESACTIVADO";
>   }
> }
> 
> 
> gracias y Saludos
> 
> 
> Gastón.
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux