Undefined variable problem with PHP function

前端 未结 5 1981
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 08:06

I\'m a PHP newbie, so I have a minor problem functions. I have this line of code:



        
5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 08:43

    If your PHP version is on 5.3 or later versions, closure can be applied.

    Closures may also inherit variables from the parent scope.

    use is the php syntax to implement closure.

    ref: Anonymous functions

        \.<\"\'\:\;\[\]\}\{\/\!\\\@\#\$\%\^\&\*\(\)\-\_\=\+\`[:space:]]/",$prom)){
                echo "Nepravilan unos imena ili prezimina!";
                echo $pera;
            }
        };
    
        // $provera($ime);
        $provera($prezime);
    

提交回复
热议问题