If you really want to do this but a bit simpler than using a class you can use:
function fn($data) {
return $data;
}
$fn = 'fn';
$my_string = <<<EOT
Number of seconds since the Unix Epoch: {$fn(time())}
EOT;
More Related Contents:
- In PHP, what does “
- How can I get a hex dump of a string in PHP?
- Remove new lines from string and replace with one empty space
- PHP, get file name without file extension
- Truncate a multibyte String to n chars
- URL Friendly Username in PHP?
- PHP: Split string [duplicate]
- Remove portion of a string after a certain character
- How can I replace a variable in a string with the value in PHP?
- Truncate text containing HTML, ignoring tags
- PHP expression
- How do I linkify urls in a string with php?
- How to split a string by multiple delimiters in PHP?
- Check whether $_POST-value is empty
- How to get email address from a long string
- use strings to access (potentially large) multidimensional arrays
- String contains any items in an array (case insensitive)
- Structure of a Serialized PHP string
- How to cast array elements to strings in PHP?
- How to reverse a Unicode string
- remove duplicate from string in PHP
- How to Convert Boolean to String
- Regex & PHP – isolate src attribute from img tag
- Delete first 3 characters and last 3 characters from String PHP
- How can I get the last 7 characters of a PHP string?
- Convert a String to Variable
- How to convert all characters to their html entity equivalent using PHP
- Remove first 4 characters of a string with PHP
- PHP extract link from tag [duplicate]
- PHP Find all occurrences of a substring in a string