Skip to content Skip to sidebar Skip to footer

Why Is There: Warning: Printf(): Too Few Arguments On Line 59

I get an error in my php code when trying to get all the files from their directory, then creating html links for them and I don't understand why. Here is the error: Warning: prin

Solution 1:

You have two %s, so the printf expects 2 arguments and you only put one.

You may want to use this one :

$filename = htmlentities($file->getBasename();
printf("<li><a href='mp3/%s'>%s</a></li>", $filename, $filename);

Post a Comment for "Why Is There: Warning: Printf(): Too Few Arguments On Line 59"