>$invdate = "14.8.2001";
>echo "$invdate\n";
>list($day, $month, $year) = split(".", $invdate);
>echo "$year-$month-$day";

split uses Regular Expressions.

This means that a whole slew of characters like [, ], |, \, $, ^, and [drum
roll please] '.' are "special".

Specifically, "." means "any damn character at all".

You could 'escape' the "." character with file://\\. and all would be good

But, it would be way easier (and more efficient if you're doing a lot of
these) to use http://php.net/explode instead, wherein *NO* characters are
"special"  (other than the usual ones for PHP itself, of course.)

As a bonus, you save yourself the headache of trying to understand Regular
Expressions. :-)

list($day, $month, $year) = explode(".", $invdate);

Besides, blowing things up is much more fun than just chopping them with an
axe :-) :-) :-)

WARNING [EMAIL PROTECTED] address is an endangered species -- Use
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to