USING $THIS in PHP

后端 未结 2 1435
旧巷少年郎
旧巷少年郎 2021-01-29 07:26

In my code I\'m trying to call a function that is inside of another function. I\'m trying to pass the $results var to the NVPToArray() function and return the result. After that

2条回答
  •  梦谈多话
    2021-01-29 08:02

    You are getting undefined function because you are calling NVPT() which not exists.

    You should call NVPToArray() function.

    And about the $this, as your $result var is defined inside the function you don't need to use it. You can call it with just $result.

    You would use it, if you had something like:

    class T {
    ...
        public $result;
    
        function yourF(){
             ....
             echo $this->result;
        }
    }
    

提交回复
热议问题