without babbling too much here's what I'm looking for:
printf("%s is the same as %s","A Duck")
to output
"A Duck is the same as A Duck";
But of course, if you know how to use it, to get that output you must provide the argument "This" twice, such as:
printf("%s is the same as %s","A Duck","A Duck");
This is a cumbersome way to give a value to a variable that is repeated many times in a formatted string. What if it was 50 times?
Yes, I can use str_replace. but wondering if this is impossible to do. I've tried giving them the same order, like so: "%1s is the same as %1s", but still doesn't work.
Thanks,
Dan
printf("%s is the same as %s","A Duck")
to output
"A Duck is the same as A Duck";
But of course, if you know how to use it, to get that output you must provide the argument "This" twice, such as:
printf("%s is the same as %s","A Duck","A Duck");
This is a cumbersome way to give a value to a variable that is repeated many times in a formatted string. What if it was 50 times?
Yes, I can use str_replace. but wondering if this is impossible to do. I've tried giving them the same order, like so: "%1s is the same as %1s", but still doesn't work.
Thanks,
Dan
Comment