I want to know how to replace some text in php string with like an include or something.
here is my example string: I have a string “bla bla bla bla {{ module:projects,id=1 }} bla bla bla bla”
I want to find {{ module:projects,id=1 }} and make it include(‘projects.php?id=1’); right where it is in the string.
how would i pull this off?
An alternative if i could do this but i cant get it to execute the php from the string would be “bla bla bla bla bla bla”
with preg_replace:
Note: you can’t actually include files with query strings on the end. PHP looks for file named ‘projects.php?id=1’.
To get the file and actually include it:
To support multiple parameters. Similar to Matmarbon’s, but is more compact, doesn’t assume parameter values will conform to \w, doesn’t escape values, but also has less room for variations in spacing (/s*).