note 126855 added to language.basic-syntax.phpmode

From: Date: Tue, 15 Feb 2022 22:39:32 +0000
Subject: note 126855 added to language.basic-syntax.phpmode
Groups: php.notes 
Request: Send a blank email to php-notes+get-217620@lists.php.net to get a copy of this message
Example for a basic implementation of ternary operator to validate and print a class in the layout. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?= $page_title ?></title> </head> <body <?= strtolower($page_slug) === 'homepage' ? 'class="page-homepage"' : ''; ?>> <section> <h1><?= $page_title ?></h1> <p>This is a paragraph.</p> </section> </body> </html> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.135 (proxied: 190.113.114.167) ---- Manual Page -- https://php.net/manual/en/language.basic-syntax.phpmode.php Edit -- https://main.php.net/note/edit/126855 Del: integrated -- https://main.php.net/note/delete/126855/integrated Del: useless -- https://main.php.net/note/delete/126855/useless Del: bad code -- https://main.php.net/note/delete/126855/bad+code Del: spam -- https://main.php.net/note/delete/126855/spam Del: non-english -- https://main.php.net/note/delete/126855/non-english Del: in docs -- https://main.php.net/note/delete/126855/in+docs Del: other reasons-- https://main.php.net/note/delete/126855 Reject -- https://main.php.net/note/reject/126855 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#217620) next »