Warning: implode(): Bad arguments.
ik heb een probleempje,en ik kom der niet uit,wat doe ik hier verkeerd ?
{
$systems = get_allow_payments('premium',$amount);
//print_r($systems);
foreach ($systems as $ps){
$ps_list[] = $ps->ps_title;
}
(dit is line 82) return implode($ps_list, ', ');
}
krijg fout melding:
Warning: implode(): Bad arguments. in /www/web1418/html/date/get_premium.php on line 82
Thnx
mvg
dus als ik het goed begrijp moet ik dan alleen de return weg halen?
}
(dit is line 82) implode($ps_list, ', ');
}
zo niet, wil je hem dan even in goede volgorde zetten.
Voorbeeld code
Code (php)
Je moet de array als tweede argument meegeven, niet als eerste. Dus de code wordt zo
(dit is line 82) return implode(', ' , $ps_list);
wil dat dan zeggen dat verder in de php alles moet veranderen ?
}
if ($_REQUEST['lstPayOptions']){
switch ($_REQUEST['lstPayOptions']) {
case '1':
$amount = "$sql_array->par_1month";
$desc = "1 Month Membership";
$params['period'] = 'month';
$params['number'] = 1;
break;
case '2':
$amount = "$sql_array->par_3month";
$desc = "3 Month Membership";
$params['period'] = 'month';
$params['number'] = 3;
break;
case '3':
$amount = "$sql_array->par_6month";
$desc = "6 Month Membership";
$params['period'] = 'month';
$params['number'] = 6;
break;
case '4':
$amount = "$sql_array->par_12month";
$desc = "12 Month Membership";
$params['period'] = 'month';
$params['number'] = 12;
break;
}
$params = mysql_escape_string(serialize($params));
$query="INSERT INTO payments SET
pay_userid = '$Sess_UserId',
pay_samount = '$amount',
pay_service = 'premium',
pay_message = '$desc',
pay_params = '$params'";
$result=mysql_query($query,$link) or die(mysql_error());
header("Location: $CONST_LINK_ROOT/payments/payment.php?payment_id=".mysql_insert_id());
}
function get_available_ps($amount)
{
$systems = get_allow_payments('premium',$amount);
//print_r($systems);
foreach ($systems as $ps){
$ps_list[] = $ps->ps_title;
}
return implode($ps_list, ',');
}
$query = " SELECT *
FROM payment_service_params
WHERE psp_service = 'premium'";
$res = mysql_query($query,$link);
$service = mysql_fetch_object($res);
?>
Code (php)
1
<?php $sess_id="PHPSESSID=".session_id(); if (get_magic_quotes_gpc()==0) $template->tpl_header=addslashes($template->tpl_header); eval("\$template->tpl_header=\"$template->tpl_header\";"); print(stripslashes($template->tpl_header)); ?>
<table width="" align="" border="0" cellspacing="" cellpadding="">
<tr>
<td align="right">
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?php
if ($Sess_UserType == "A") {
print("<a href='$CONST_LINK_ROOT/admin.php?PHPSESSID=".session_id()."'><img border='0' src='$CONST_LINK_ROOT/images/$CONST_IMAGE_LANG/mem_$Sess_Userlevel.gif' width='$CONST_MEMIMAGE_WIDTH' height='$CONST_MEMIMAGE_HEIGHT'>");
} else {
print("<img border='0' src='$CONST_LINK_ROOT/images/$CONST_IMAGE_LANG/mem_$Sess_Userlevel.gif' width='$CONST_MEMIMAGE_WIDTH' height='$CONST_MEMIMAGE_HEIGHT'>");
}
if ($Sess_UserType == "A") {
print("<a href='$CONST_LINK_ROOT/admin.php?PHPSESSID=".session_id()."'><img border='0' src='$CONST_LINK_ROOT/images/$CONST_IMAGE_LANG/mem_$Sess_Userlevel.gif' width='$CONST_MEMIMAGE_WIDTH' height='$CONST_MEMIMAGE_HEIGHT'>");
} else {
print("<img border='0' src='$CONST_LINK_ROOT/images/$CONST_IMAGE_LANG/mem_$Sess_Userlevel.gif' width='$CONST_MEMIMAGE_WIDTH' height='$CONST_MEMIMAGE_HEIGHT'>");
}
en Jah hoor krijg zelfde probleem,(na verandering)
function get_available_ps($amount) {
$systems = get_allow_payments('premium', $amount);
//print_r($systems);
foreach ($systems as $ps) {
$ps_list[] = $ps->ps_title;
}
return implode($ps_list, ',');
}
en da's nog steeds verkeerd om ;-)
ik heb het al veranderd
}
function get_available_ps($amount)
{
$systems = get_allow_payments('premium',$amount);
//print_r($systems);
foreach ($systems as $ps){
$ps_list[] = $ps->ps_title;
}
return implode(', ' , $ps_list);
}
maar met alle woorden moet ik alles veranderen dan?
of alleen deze stuk?
}
return implode(', ' , $ps_list);
}
alleen de implode
{
$systems = get_allow_payments('premium',$amount);
//print_r($systems);
foreach ($systems as $ps){
$ps_list[] = $ps->ps_title;
}
return implode(', ' , $ps_list);
}
$ps_list[] = $ps->ps_title;
}
Weet je zeker dat de elementen in de array $systems allemaal van het type "object" zijn?