I am trying to duplicate my C# string formatting where i can do something like this:
Console.Writeline("My name is [0]. I have been a [1] for [2] days.", "bob", "member", "12")
I want to be able to do this in PHP, but as far as I know the only function that resembles this is sprintf(). Is there a function that is identical to the one above
echo function("My name is [0]. I have been a [1] for [2] days.", "bob", "member", "12")
sprintf()? It is more or less identical to C#'s string formatting.%s,sprintfis basically type-agnositc as well. You don't have to use any of the other types.sprintfallows that as well, only the syntax is not as nice:%1$s.