Support

Account

Home Forums Front-end Issues Compare field with string Reply To: Compare field with string

  • In your sample $lien contains the <br> in the string, whereas $lien2 only contains the link string and not the <br>.

    If you do this it should return true:

    
    $lien = get_field('fieldName');
    echo $lien.'<br/>';
    $lien2 = 'http://link.com';
    echo $lien2.'<br/>';
    if($lien2==$lien):
     echo "same";
    else:
    echo "not same";
    endif;