note 54916 added to language.functions
| From: | p at onion dot whitefyre dot com | Date: | Tue, 19 Jul 2005 15:39:08 +0000 |
| Subject: | note 54916 added to language.functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92173@lists.php.net to get a copy of this message | ||
One potentially useful feature is that in function and variable names bytes within 0x7f-0xff are
allowed. This means you can use any UTF-8 in a variable name.
As a simple example (this only uses latin-1 characters, but the concept is the same):
<?php
function ²($n) {
return pow($n, 2);
}
function ¶($string) {
return '<p>'.str_replace("\n\n", "</p>\n<p>",
$string).'</p>';
}
echo ²(4); //16
echo ¶("Some text\n\nbroken into paragraphs");
?>
You can use this to write PHP code in your native language, or even better make creative use of
symbols like above to make your code understandable by everyone.
----
Manual Page -- http://www.php.net/manual/en/language.functions.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54916
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54916&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54916&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54916&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54916&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54916&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54916&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54916&report=yes
Search -- http://master.php.net/manage/user-notes.php