I'm not exactly sure what this is called but is common in programming, often using the ? instead of the % which I use in this example.
Say I have a string:
"How many % does it take the build a % out of aluminum cans?"
And I want to replace the % symbol with specific values from an array based on their index and the position in the string. In this case:
['robots', 'laser gun']
The result would be:
How many robots does it take to build a laser gun out of aluminum cans?
Is there any way to easily accomplish this in PHP?