gpt4 book ai didi

php mysql+ 注意 : Array to string conversion in C

转载 作者:行者123 更新时间:2023-11-29 13:54:14 25 4
gpt4 key购买 nike

当我尝试用逗号分解数组时,我不断收到此错误,任何人都可以帮助我如何修复此错误???

friend_request.php

 <?php

if(isset($_POST['acceptrequest'.$user_from]))
{
//select the friend array row from the logged in user
$get_friend_check = mysql_query("SELECT friend_array FROM user WHERE user_name = '$login_user'") or die(mysql_error());
$get_friend_row = mysql_fetch_assoc($get_friend_check);
$friend_array = $get_friend_row['friend_array'];
$friendArray_explode = explode(",", $friend_array);
echo $friendArray_explode;
}
?>

The last line of code produce this error how to fix it ??

最佳答案

这是一个注意(不是错误!) - 您正在尝试像字符串一样打印数组。使用 print_rvar_dump 代替 echo:

print_r($friendArray_explode);

关于php mysql+ 注意 : Array to string conversion in C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16129670/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com