PHP: Start/end tags - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

if..endif syntax old_function

Last updated: Sat, 27 Jan 2007

view this page in

# Start/end tags

The first thing you probably will notice is that PHP's start and end tags have changed. The old `<? >` form has been replaced by three new possible forms:

Пример D-1. Migration: old start/end tags

`<? echo "This is PHP/FI 2.0 code.\n"; >`

As of version 2.0, PHP/FI also supports this variation:

Пример D-2. Migration: first new start/end tags

`<? echo "This is PHP 3.0 code!\n"; ?>`

Notice that the end tag now consists of a question mark and a greater-than character instead of just greater-than. However, if you plan on using XML on your server, you will get problems with the first new variant, because PHP may try to execute the XML markup in XML documents as PHP code. Because of this, the following variation was introduced:

Пример D-3. Migration: second new start/end tags

`<?php echo "This is PHP 3.0 code!\n"; ?>`

Some people have had problems with editors that don't understand the processing instruction tags at all. Microsoft FrontPage is one such editor, and as a workaround for these, the following variation was introduced as well:

Пример D-4. Migration: third new start/end tags

`<script language="php"> echo "This is PHP 3.0 code!\n"; </script>`

add a note User Contributed Notes
Start/end tags
There are no user contributed notes for this page.
if..endif syntax old_function

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST