如果第一个高级自定义字段为空,请在<a> -tag中使用其他字段

So I am using Advanced Custom Fields for Wordpress, and I have a repeater sub_field where you either can link a file for download, or choose a page link in a different field for an tag my page. My two fields are named: fil_url page_url

This is my normal markup, which returns one, in this case the uploaded file. php/html:

<a href="<?php the_sub_field('fil_url')):) ?>open</a>

So what I want is an if-statement that says that if fil_url is empty, then display page_url instead. But I'm not sure how to write this. Plz help :)

<?php
    $file_url = get_sub_field( 'fil_url' );
    $href = ( ! empty( $file_url ) ) ? get_sub_field( 'fil_url' ) : get_sub_field( 'page_url' );
    echo '<a href="' . $href . '">open</a>';
?>

After tinkering with @diggy's post I found this sollution:

<?php
$href = ( get_sub_field( 'fil_url' ) ) ? get_sub_field( 'fil_url' ) : get_sub_field( 'page_url' );
<?>