note 61605 added to tutorial.useful
| From: | FreeJedi at osu1 dot php dot net | Date: | Tue, 07 Feb 2006 19:10:31 +0000 |
| Subject: | note 61605 added to tutorial.useful | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103225@lists.php.net to get a copy of this message | ||
When coding it is convenient to think of structure like this:
? > something < ? php
as almost fully equivalent of
echo "something";
i.e. you can replace one with another in functions, blocks and everywhere.
For example, the following code:
<?php
function foo() {
?> Foo is called. <?php
}
function boo() {
?> Boo is called. <?php
}
if (1) foo();
else boo();
boo();
foo();
?>
gives the same result as:
<?php
function foo() {
echo "Foo is called. ";
}
function boo() {
echo "Boo is called. ";
}
if (1) foo();
else boo();
boo();
foo();
?>
the output in both cases is "Foo is called. Boo is called. Foo is called. "
----
Server IP: 195.54.192.44
Probable Submitter: 62.181.55.67 (proxied: unknown)
----
Manual Page -- http://www.php.net/manual/en/tutorial.useful.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61605
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61605&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61605&report=yes
Search -- http://master.php.net/manage/user-notes.php