Re: Undefined offset notice with explode



*** Richard Lawrence wrote/escribió (31 May 2005 01:55:16 -0700):
> list($key, $value) = explode(":", $line, 2);

Not as elegant as list but...


$pair=explode(":", $line, 2);

if(count($pair)==2){
echo $pair[0];
echo $pair[1];
}



--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
.