I\'m getting this PHP error in my custom breadcrumb function:
Warning: sprintf(): Too few arguments in /srv/bindings/56058a57d7424f84adac37ba6b03d3b7
in my case: for example:
$data = call_web_service(); // return array()
foreach ($data as $d)
echo sprintf("<div>our %65 discount is : %s </div>",
$d["discount"]
);
use %65 in my string
sprintf seek every % and if counts of them is not equal to your parameters return this error
like this :
$weekday = "sunday";
echo sprintf("<div>our <?php echo $date;?> day is : %s </div>",
$weekday
);
Your sprintf string has 2 placeholders, your filling one.
<?php
// bad
echo sprintf('<a href="%1$s">%2$s</a>', 'http://example.com');
// good
echo sprintf('<a href="%1$s">%2$s</a>', 'http://example.com', 'Link Name');
https://3v4l.org/nu8Ht