But hold on this is not going to work the output we will get isMy name is Gates and my age is 55,I work in Microsoft45
The 45 is number of characters are there in string.
So to avoid this we do slightly other way,
we use sprintf() function.
The only difference between sprintf() and printf() is that sprintf() stores the value in variable.

$name = "Gates";$age = 55;$work = "Microsoft"$output = sprintf("My name is %s and my age is %d,I work in %s",$name,$age,$work);echo $output;

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…