Introduction to 4 markup styles in php_PHP Tutorial

WBOY
Release: 2016-07-21 15:18:35
Original
946 people have browsed it

When I was reading the forum today, I saw an error code from a newbie. After looking at it for a long time, I didn't find the error. What am I wondering? (Why is this?) Haha.
The tag problem was discovered later. He was using short tags. And it is not enabled in my php.in configuration. Oh, I’m so ashamed!

1.xml style (standard style is recommended)

Copy code The code is as follows:

echo "This is an xml style tag";
?>

xml style tags are commonly used tags and are recommended The tag used cannot be disabled by the server. This style of tag can be used in xml and xhtml.

2. Script style

Copy code The code is as follows:




3. Short style

Copy code The code is as follows:



Note: You need to set short _open_tag=on in php.ini, the default is on, or add the –enable-short-tags option when compiling PHP. (PHP 3 version can also activate the use of short tags through the short_tags() function.)


4.asp style

Copy code The code is as follows:

<%
echo 'This is an asp style tag';
%>


Note : Need to turn on asp_tags = on in the php.ini configuration file;

The above asp style and short style need to be set in php.ini. Not supported by default.

Note: Support for ASP style tags was added in version 3.0.4.

Note: Avoid using short tags in the following situations: developing programs or libraries that need to be distributed, or developing on servers that are not controlled by the user. Because the target server may not support short tags. For code portability and distribution, make sure not to use short tags.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325475.htmlTechArticleWhen I was reading the forum today, I saw an error code from a newbie, and I couldn’t find the error after looking at it for a long time. What am I wondering? (Why is this?) Haha. Later I discovered the marking problem and he used...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template