Just wondering if there is a way around this (or if it is even possible).
So I have a section of code similar to this. I have a string, with a value that contains square brackets, similar to those used when accessing an array key. I want to create that array key itself by using the strings value. I hope this code makes a little more sense of what I mean.
// String that has a value similar to an array key
$string = 'welcome["hello"]';
$$string = 'thisworks';
// I could then print the array keys value like this
print( $welcome["hello"] );
// This would hopefully output 'thisworks'.
Can't seem to get it to work correctly, however. Is it possible (or how else can I go about it)?