php代码替换a = 1; b = 2等等......使用paramaterized函数

时间:2015-08-11 15:20:29

标签: php

我想替换a = 1; b = 2,c = 3,z = 26就像那样......我创造了一个函数..

但是下面的函数显示了一个错误。这段代码有什么问题?

INSERT INTO `tbluserscenescores`(`suid`, `completed`, `score`, `attempts`) 
VALUES (`1`, `1`, `7`, `1`),
       (`2`, `0`, `0`, `4`),
       (`3`, `0`, `10`, `2`),
       (`4`, `0`, `30`, `5`)

3 个答案:

答案 0 :(得分:2)

您反向传递$encoded但此变量为空,请使用$str进行更改。

$str = "abc";
echo reverse($str);

答案 1 :(得分:1)

'$ encoded'仅存在于您的函数中.. 用'$ str'调用你的函数。

$str = "abc";
echo reverse($str);

答案 2 :(得分:0)

1)打开php http://php.net/manual/en/function.error-reporting.php

中的错误显示

2)您正在向函数

发送$ encoded而不是$ str

3)下次尝试做自己的功课