[BUG?] substr giving strange results
| From: | Jean-Christian Imbeault | Date: | Tue, 09 Oct 2001 13:54:12 +0000 |
| Subject: | [BUG?] substr giving strange results | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70473@lists.php.net to get a copy of this message | ||
Ok, either I missed something really simple or ...
Here's the code:
$comp = trim($data->comp);
$YY = substr($comp,0,3); $MM = substr($comp,5,6); $DD = substr($comp,8,9);echo "COMP is $comp<BR>"; echo "DATE is $YY" . "," . "$MM" . "," . $DD; The results are: COMP is 2002-10-29 DATE is 200,10-29,29 Now, shouldn't it be: COMP is 2002-10-29 DATE is 2002,10,29 This exact code snippet works fine one another page but not this one ... What is the obvious thing I am not seeing? Jc _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp