List Info

Thread: note 61605 added to tutorial.useful




note 61605 added to tutorial.useful
user name
2006-02-07 19:10:31
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 -- htt
p://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.p
hp.net/manage/user-notes.php?action=delete+61605&report=
yes&reason=useless
Delete: non-english         -- http://mast
er.php.net/manage/user-notes.php?action=delete+61605&rep
ort=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://ma
ster.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

note 61605 deleted from tutorial.useful by sp
user name
2006-02-07 19:41:26
Note Submitter: Free Jedi
Reason: already in docs

----

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. "

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )