csplrj Posted June 6, 2007 Share Posted June 6, 2007 I am getting the below error though the said error. Warning: Wrong parameter count for array_slice() in /home/www/a.com/drona/templates_c/%%C8^C82^C821C881%%register.tpl.php on line 363 What can be reason for the same Thanks in advance CSJakharia Quote Link to comment https://forums.phpfreaks.com/topic/54424-warning-wrong-parameter-count-for-array_slice/ Share on other sites More sharing options...
Psycho Posted June 6, 2007 Share Posted June 6, 2007 Impossible to help without seeing the code. That function takes a minimum of two parameters: an array and an offset. Are you providing both of those to the function? Quote Link to comment https://forums.phpfreaks.com/topic/54424-warning-wrong-parameter-count-for-array_slice/#findComment-269142 Share on other sites More sharing options...
csplrj Posted June 6, 2007 Author Share Posted June 6, 2007 The Smarty function i wrote is {html_checkboxes name='subject' options=$arraySubject|@array_slice:0:4:true selected=','|@split:$row.subject} This is written in Smarty Template and the output of {$arraySubject|@count} is 31 which shows that array has values This works on my machine which has PHP 5.2.1 but does not works on PHP 4.4.2 Thanks in advance CSJakharia Quote Link to comment https://forums.phpfreaks.com/topic/54424-warning-wrong-parameter-count-for-array_slice/#findComment-269158 Share on other sites More sharing options...
Psycho Posted June 6, 2007 Share Posted June 6, 2007 Ok, in addition to not providing any code you left out two VERY important bits of information. namely that you are using Smarty templates and that it works in one environment and not another. Sorry, but I don't use templates. But looking at this page: http://www.phpfreaks.com/smarty_manual/page/language.function.html.checkboxes.html your implementation looks nothing like the example. Quote Link to comment https://forums.phpfreaks.com/topic/54424-warning-wrong-parameter-count-for-array_slice/#findComment-269237 Share on other sites More sharing options...
per1os Posted June 6, 2007 Share Posted June 6, 2007 Did you look at www.php.net/array_slice and look at the difference between PHP 4 and PHP 5 ??? Quote Link to comment https://forums.phpfreaks.com/topic/54424-warning-wrong-parameter-count-for-array_slice/#findComment-269242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.