note 77851 added to function.define
| From: | rayro at gmx dot de | Date: | Sat, 15 Sep 2007 21:53:00 +0000 |
| Subject: | note 77851 added to function.define | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130527@lists.php.net to get a copy of this message | ||
just a note to the previous post by e s lin d sey at g mail dot co m:
Well as u said, it is not the best workaround. To resolve this "Problem" without getting
incredible loss of performance, you are able to make the use of "variable functions" like
"variable variables":
<?php
$def = 'constant';
$string = <<<END
This is PHP running on<br />
{$def('PHP_OS')}
END;
var_dump($string);
?>
In this example we make use of the "constant" function which is builtin, and it will
output:
string(37) " This is PHP running on
WINNT"
Tested on PHP 5...
Best regards
----
Server IP: 217.13.201.10
Probable Submitter: 84.135.73.62
----
Manual Page -- http://www.php.net/manual/en/function.define.php
Edit -- https://master.php.net/note/edit/77851
Del: integrated -- https://master.php.net/note/delete/77851/integrated
Del: useless -- https://master.php.net/note/delete/77851/useless
Del: bad code -- https://master.php.net/note/delete/77851/bad+code
Del: spam -- https://master.php.net/note/delete/77851/spam
Del: non-english -- https://master.php.net/note/delete/77851/non-english
Del: in docs -- https://master.php.net/note/delete/77851/in+docs
Del: other reasons-- https://master.php.net/note/delete/77851
Reject -- https://master.php.net/note/reject/77851
Search -- https://master.php.net/manage/user-notes.php