0
function countdown($month, $day, $year)
{
    return ceil( ( mktime( 0,0,0,$month,$day,$year ) - time() ) / 86400 );
}
class dates
{
    public $month;
    public $day;
    public $year;
}
$exp = new dates;

echo countdown($exp->month, $exp->day, $exp->year);

*Parse error: syntax error, unexpected T_STRING in /var/www/pfn/*

Just learning php, trying to use a php class as a C struct, but for some reason, I can't pass the variables into the function, why is this?

1 Answer 1

3

Remove the $ sign at $return.

function countdown($month, $day, $year)
{
    return ceil( ( mktime( 0,0,0,$month,$day,$year ) - time() ) / 86400 );
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.