note 103618 deleted from language.types.string by salathe
| From: | salathe@php.net | Date: | Fri, 29 Apr 2011 13:03:05 +0000 |
| Subject: | note 103618 deleted from language.types.string by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179268@lists.php.net to get a copy of this message | ||
Note Submitter: jeff at kingdesk dot com
Reason: bad code
----
Here is a hack for evaluating php expressions inside a double quoted string:
<?php
class E {
function val( $string ) {
return eval( $string );
}
}
$e new E();
echo "2 + 2 = {$e->val('2+2')}";
?>
This echos "2 + 2 = 4".