mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Begin with revision of language section.
basic-syntax: - Added note about revision, and progress-info - Explained escaping a bit more eleborately - Explained escaping inside control structures (quite badly, I admit, but still) types: - Added null and resource - Categorized in scalars, compound and special - Added 'converting to xxx' section for boolean and integer (rest follows some day) - Moved 'when is something considered true' to that new section, and updated it. - Added overflow and converting notes to integer. Referred to float-precision warning. - Added section about resource-freeing - In type-juggling, referred to the new 'convert to xxx' sections. - fixed some xml-tags - converted most > to > git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@47584 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3376cff8d1
commit
64e21277b7
1 changed files with 82 additions and 3 deletions
|
@ -1,12 +1,63 @@
|
|||
<chapter id="language.basic-syntax">
|
||||
<title>Basic syntax</title>
|
||||
|
||||
<!--
|
||||
|
||||
NOTE: Last modified: 2001-05-16 13:00 GMT
|
||||
|
||||
the language part is currently under heavy revision. Please do not
|
||||
not make any heavy (i.e. structural) modifications to this part
|
||||
for a moment.
|
||||
|
||||
You'd also better not start any translation yet.
|
||||
|
||||
Comments are always welcome at phpdoc@lists.php.net
|
||||
|
||||
Progress:
|
||||
|
||||
intro : DOESN'T EXIST - yet?
|
||||
new chapter, with some introductionary remarks?
|
||||
Will be discussed on the ML soon.
|
||||
basic-syntax:
|
||||
FISISHED
|
||||
except maybe moving the 'advanced escaping'
|
||||
to a better place?
|
||||
TODO:
|
||||
- nada
|
||||
types : Being revised. Added all new types
|
||||
Boolean and Integer are more or less finished.
|
||||
The rest isn't.
|
||||
TODO:
|
||||
- why is $foo[bar] bad syntax?
|
||||
- what's the difference between unset($bla) and
|
||||
$bla = NULL (it is different!)
|
||||
- $obj->{expr} syntax
|
||||
- (unset) cast?????
|
||||
- $bla = unset <== should've been nuked, don't mention it
|
||||
- $str{offset} syntax, rather than $str[offset]
|
||||
- read notes and apply when any of them are useful
|
||||
- remove notes which have been included here.
|
||||
- ...
|
||||
the rest: Not yet started with.
|
||||
TODO:
|
||||
- ?
|
||||
|
||||
-->
|
||||
|
||||
<sect1 id="language.basic-syntax.phpmode">
|
||||
<title>Escaping from HTML</title>
|
||||
|
||||
<para>
|
||||
There are four ways of escaping from HTML and entering "PHP code
|
||||
mode":</para>
|
||||
When PHP starts to handle file, it will just output the text
|
||||
it encouters. So if you have a HTML-file, and you change its
|
||||
extension to .php, your file will keep working.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you want to insert php-statements at some point in your
|
||||
file, you'll need to indicate so to php, by entering "PHP mode"
|
||||
in either of the following ways:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<example>
|
||||
|
@ -53,7 +104,35 @@
|
|||
|
||||
<para>
|
||||
The closing tag for the block will include the immediately
|
||||
trailing newline if one is present.</para></sect1>
|
||||
trailing newline if one is present.
|
||||
</para>
|
||||
|
||||
<para> <!-- TODO: find a better place for this para -->
|
||||
PHP allows you to use structures like this:
|
||||
<example><title>Advanced escaping</title>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
|
||||
if ( boolean-expression )
|
||||
{
|
||||
?>
|
||||
<strong>This is true.</strong>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<strong>This is false.</strong>
|
||||
<?php
|
||||
}
|
||||
</programlisting></example>
|
||||
|
||||
This works as expected, because PHP handles text within ?> and
|
||||
<?php as an <function>echo</function> statement.
|
||||
<!-- without the parsing if vars, that is (hopefully?) obvious -->
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="language.basic-syntax.instruction-separation">
|
||||
<title>Instruction separation</title>
|
||||
|
|
Loading…
Reference in a new issue