RE: [PHP-ES] Problemas con array_slice
| From: | Horacio Degiorgi | Date: | Thu, 07 Jun 2001 09:22:59 +0000 |
| Subject: | RE: [PHP-ES] Problemas con array_slice | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-10992@lists.php.net to get a copy of this message | ||
exacto el primer parametro tiene que ser un array y en tu caso es un string
intuyo que lo que tratás de hacer es usar un substr()
$ult_dia=substr($fecha,0,2);
salu2
horacio
----- Original Message -----
From: xavi <berna@farmavet.com>
To: Llista PHPes <lista@phpes.com>
Sent: Thursday, June 07, 2001 10:58 AM
Subject: [PHP-ES] Problemas con array_slice
> Tengo un array, que representa una fecha, y lo quiero partir en tres
partes:
>
> $fecha="12062001";
> $ult_dia=array_slice($fecha,0,2);
> $ult_mes=array_slice($fecha,2,2);
> $ult_any=array_slice($fecha,4,4);
>
> Y me da el siguiente error:
>
> Warning: First argument to array_slice() should be an array
>
> Cual es el problema?
>
> ---------------------------------------------------------------------
> Archivo On-line: http://www.phpes.com/
> Manual PHP en español: http://www.php.net/manual/es/
> Para dar de baja la suscripción, mande un mensaje a:
> lista-unsubscribe@phpes.com
>
>