dongzichan2886 2012-10-11 12:41
浏览 60
已采纳

PHP函数名称必须是新变量的字符串错误

I am getting the error:

Function name must be a string on this code:

$profile_data = $user_data('first_name','last_name','email');

Any ideas why this could be?

  • 写回答

2条回答 默认 最新

  • douwei1128 2012-10-11 12:44
    关注

    While you can use variables as function-names, to do so requires the variable to be a string.

    The variable $user_data sounds more like an array, or even possibly an object. If this is true, you will receive the error specified. Per the comment from @Jon, it could also be possible that user_data() is a method and the $ is a typo.

    If none-of-the-above helps, please all relevant code, specifically the creation of the $user_data variable (or a var_dump($user_data) output).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。