Jump to content

Delayed variable expansion


shunyata

Recommended Posts

This works fine:

$content[0] = "string";
$content[1] = "this is a {$content[0]}";
$content[2] = "this is a {$content[0]} saying that {$content[1]}";

 

Suppose however that i cannot control the order of these declarations. Is there a way to delay variable expansion until a time of my choosing? I could of course use eval() to convert from single to double quoted, but again I would have to do that in the right order for recursive expansion.

 

Grateful for any comments.

 

 

Link to comment
https://forums.phpfreaks.com/topic/96151-delayed-variable-expansion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.