0

Is there a way to interpret variables, constants and arrays in a string?
Unfortunately, I have no influence on the creation of the string.

just a $test, for myself

or

please use path dirname(__FILE__) for

or

i like $['fruits'] on mondays

kolja
  • 505
  • 7
  • 24
  • _I have no influence on the creation of the string._ How can you change anything if you can't touch the code? – Simone Rossaini Jun 25 '21 at 10:21
  • The strings come from a configuration file. – kolja Jun 25 '21 at 10:30
  • 1
    There's no built-in function to do this, so you need to work with **regular expressions**. [Here](https://stackoverflow.com/a/19563063/1529324) you can find a good start. However in your case it will be more complex as you're also looking for methods such as `dirname` – Andrea Olivato Jun 25 '21 at 10:43

0 Answers0