Jump to content

func_get_args doesn't work?


newbtophp

Recommended Posts

Im using func_get_args, but it gives an error?:

 

Too few arguments?, when its correct (as the number of %s = the number of values within $args)

 

<?php
function sprintify() {
global $urls;
$args = func_get_args();
$input = $args[0];
unset($args[0]);
return sprintf($urls[$input], implode(', ', $args));
}

echo sprintify('default', 46, 464, 46);

/*
For your information:
$urls['default'] = '%s/%s/%s';
*/
?>

Link to comment
https://forums.phpfreaks.com/topic/210319-func_get_args-doesnt-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.