Книга: Fedora™ Unleashed, 2008 edition
Entering and Exiting PHP Mode
Entering and Exiting PHP Mode
Unlike PHP's predecessors, you embed your PHP code inside your HTML as opposed to the other way around. Before PHP, many websites had standard HTML pages for most of their content, linking to Perl CGI pages to do back-end processing when needed. With PHP, all your pages are capable of processing and containing HTML.
Each .php
file is processed by PHP that looks for code to execute. PHP considers all the text it finds to be HTML until it finds one of four things:
? <?php
? <?
? <script language="php">
The first option is the preferred method of entering PHP mode because it is guaranteed to work.
After you are in PHP mode, you can exit it by using ?>
(for <?php
and <?);%>
for <%
) or </script>
(for <script language="php">
). This code example demonstrates entering and exiting PHP mode:
In HTML mode
<?php
echo "In PHP mode";
?>
In HTML mode
In <?php echo "PHP"; ?> mode
- Разработка приложений баз данных InterBase на Borland Delphi
- Open Source Insight and Discussion
- Introduction to Microprocessors and Microcontrollers
- Chapter 6. Traversing of tables and chains
- Chapter 8. Saving and restoring large rule-sets
- Chapter 11. Iptables targets and jumps
- Chapter 5 Installing and Configuring VirtualCenter 2.0
- Chapter 16. Commercial products based on Linux, iptables and netfilter
- Appendix A. Detailed explanations of special commands
- Appendix B. Common problems and questions
- Appendix E. Other resources and links
- IP filtering terms and expressions