douyao1856 2011-11-01 13:46
浏览 15

不明原因的变量变化(可能)

i have this function

    function ecr_form_save($data) {
/* data value
array(
['result'] =>
'ok'
)
*/
        $result = validate_form($data);
        global $firephp;    
        $firephp->log($result, 'Iterators');
        //return $result;   //return 1

        if ($result['result']=="ok") {
            return $result; //return 2
        } else {
            return $result; //return 3
        }

    }

When i uncoment return 1 everything works, but if i comment return 1 and try to get output from return 2 or 3 i get error

Any idea what is going on with that.

yes ,it is always is returning array like this array('result'=>'ok') or like this array('error'=>'"Beigu rādījums" ir jābūt veselam skaitlim') , depending on what input form has.

if i change if statement to if ( 1==1) it works to

  • 写回答

3条回答 默认 最新

  • drus39136 2011-11-01 13:57
    关注

    u have to do

    array("result" =>"ok");
    

    now try it's work.

    评论

报告相同问题?