Hide text if one custom field out of two is empty [closed]

The PHP function implode() lets you stick multiple strings from an Array with another string between them. If there’s only one value in the Array, then the string that goes between items won’t appear.

So you can start by creating an Array. Then, if there’s values for your meta, put the values into the Array and implode() them with and as the string. You can also check if the Array is empty and avoid outputting at all if it is:

$giving_back = array();

$givingback_details_funds = get_post_meta( $post->ID,'givingback_details_funds', true );

if ( $givingback_details_funds ) {
    $giving_back[] = $givingback_details_funds;
}

$givingback_details_days = get_post_meta( $post->ID, 'givingback_details_days', true );

if ( $givingback_details_days ) {
    $giving_back[] = _n( 'one working day', $givingback_details_days. ' working days', $givingback_details_days );
}

if ( ! empty( $giving_back ) ) {
    echo 'the team donated' . implode( ' and ', $giving_back );
}

Also notice that I used the WordPress function _n() to output different strings based on whether $givingback_details_days is greater than 1 or not.