vendredi 21 juillet 2017

Check if null and empty string in Laravel view

in my view I have to output separately the one that is null and the one that is empty string

so i have this:

@if( $str->a == null)
... // do somethin
@endif

@if( $str->a == '')
... // do somethin
@endif

the problem is they the same result.

Thanks

Aucun commentaire:

Enregistrer un commentaire