+ 2
Как соединить HTML и PHP? [↓ ENG ↓]
How to mix HTML and PHP? [RUS]: Как в коде PHP сделать перенос строки как в HTML? <p> </p> не работает. [ENG]: How to make a line break in PHP code like in HTML? <p> </ p> not working.
4 ответов
+ 2
Mixing HTML and PHP. PHP code is normally mixed with HTML tags. PHP is an embedded language, meaning that you can jump between raw HTML code and PHPwithout sacrificing readability
While HTML is a mark-up language and is used in front-end Web Development that is responsible to the web-page's layouttogether with CSS and Javascript. PHP as a server-side language is usually used to program the manipulation of web pages made with HTML.
+ 1
Parth Lakhani Please show sample code.
+ 1
Wait for few minutes
+ 1
1. <?php echo 'if you want to serve PHP code in XHTML or XML documents,
use these tags'; ?>
2. You can use the short echo tag to <?= 'print this string' ?>.
It's always enabled in PHP 5.4.0 and later, and is equivalent to
<?php echo 'print this string' ?>.
3. <? echo 'this code is within short tags, but will only work '.
'if short_open_tag is enabled'; ?>
4. <script language="php">
echo 'some editors (like FrontPage) don\'t
like processing instructions within these tags';
</script>
This syntax is removed in PHP 7.0.0.
5. <% echo 'You may optionally use ASP-style tags'; %>
Code within these tags <%= $variable; %> is a shortcut for this code <% echo $variable; %>
Both of these syntaxes are removed in PHP 7.0.0.
I think this will help you