3 ms·
We'd have PHP in the browser.
by gregjor 7y ago
We'd have PHP in the browser.
- ferzul 7y agoif php had a html-in-php syntax, that might be true. but as anyone who has ever worked with php and jsx knows, this isn't true
- gregjor 7y agoPHP has multiple ways to mix HTML and PHP, that’s part of its design. The simplest way to put a block of HTML inside PHP code is with the heredoc string syntax. As of PHP 7.3 heredocs allow indenting of the closing label, fixing the slight ugliness of heredocs. You can also just switch in and out of PHP to an HTML block.