Is there an equivalent python str.format in PHP?
In Python:
"my {} {} cat".format("red", "fat")
All that I see, I can do in PHP initially by naming entries and using str_replace :
str_replace(array('{attr1}', '{attr2}'), array('red', 'fat'), 'my {attr1} {attr2} cat')
Are there any other alternatives to PHP?
python php replace
JeromeJ
source share