doutou3725 2013-03-27 19:51
浏览 11
已采纳

PHP函数不接受参数[关闭]

I'm currently experiencing a problem with a php function. I have declared a function:

    function edit_content($array, $id = NULL){
        //code
    }

Where $array is an array passed to the function and $id is an optional integer value. When I call the function for example like this:

edit_content($content_array, 2);

the value 2 doesn't get passed.

Why wouldn't the value not get passed? Does it have something to do with the array being passed?

  • 写回答

1条回答 默认 最新

  • dongqu2863 2013-03-27 20:21
    关注

    The problem wasn't in the code after all but in cache. I forgot to clean the cache after changing the ajax call a bit and it resulted in calling the function under different condition (where ID is not passed because it is not needed.

    Thank you for your help and I'm sorry for taking your time. Have a great day!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100