Vote Up 0 Vote Down

sprintf() [function.sprintf]: Too few arguments

I got the error

Warning (2) : sprintf() [function.sprintf]: Too few arguments

For the following code :

sprintf('The customer name is %s and called as  %s% ',$name);
flag
edited on 17/6/12

Answers


Vote Up 0 Vote Down
As the error says the number of arguments passed is not enough in your code. Two placeholders are there, so the code should be :

sprintf('The customer name is %s and called as  %s% ',$name,$name);
flag | link |

We can use place holders %1$s and %1$s also instead of giving two arguments

johnny on 29/6/12

Your Answer

Login before answering

Login with facebook