On 16 Jul 01, at 15:25, Tyler Longren wrote:

> <?
> function expDate($date) {
>         $month = substr("$date", 0, 2);
>         $len = strlen($date);
>         $year = substr("$date", $len-2, $len);
>         return $month;
>         return $year;
> }
> expDate("11/2002");
> print "$month $year";
> ?>

<?
function expDate($date)
{
    $month = substr($date, 0, 2);
    $year = substr($date, strlen($date) - 2, 2);
    return "$month $year";
}

$monyr = expDate("11/2002");
print "$monyr";
?>

would do it I expect.

CYA, Dave


-----------------------------------------------------------------------
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au          mailto:[EMAIL PROTECTED]
-----------------------------------------------------------------------

-- 
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