5 PHP short If / Else (PHP 7.x: kurze If / Else - Abfrage)

<?php $var = ""; if(!empty($var)) { echo $var; } else { echo 'default'; } if(!empty($var)): echo $var; else: echo 'default'; endif; echo !empty($var) ? $var : 'default';
5 kurze If / Else (Wenn / Dann) Schreibweise in PHP (inkl. Elvis operator)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.