This construct:

        list($v1, $v2, $v3) = explode($sep, $string, 3);

will generate NOTICE level errors if there are not enough parts of the 
string to fill all the variables in the list.  What I really want is 
for list() to set the variables that have a corresponding array 
element, and then either don't change the others, or set them to NULL --
I could live with either approach.

Anyone see a way to get rid of these errors short of this approach:

        $parts = explode($sep, $string, 3);
        switch(count($parts)) {
                case 3:
                        $v3 = $parts[2];
                case 2:
                        $v2 = $parts[1];
                case 1:
                        $v1 = $parts[0];
        }

I did try @list(... and it made no difference.

Thanks,

--
Tom

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

Reply via email to