Saturday, 7 September 2019

php - Outputing HTML with PHP7 null coalesce

I want to use PHP7's Null Coalesce feature to output HTML, is this possible?



{{$site->address_line_2 ?? "Address Line 2"}}




Im currently using Laravel and blade, and the above outputs



Address Line 2



As a string instead of a HTML tag with the content Address Line 2

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...