PHP curly string syntax question
Posted
by zildjohn01
on Stack Overflow
See other posts from Stack Overflow
or by zildjohn01
Published on 2010-05-06T16:00:45Z
Indexed on
2010/05/06
16:08 UTC
Read the original article
Hit count: 239
I'm running PHP 5.3.0. I've found that the curly string syntax only works when the first character of the expression is $
. Is there a way to include other types of expressions (function calls, etc)?
Trivial example:
<?php
$x = '05';
echo "{$x}"; // works as expected
echo "{intval($x)}"; // hoped for "5", got "{intval(05)}"
© Stack Overflow or respective owner