php variable undefined inside function argument

Solutions on MaxInterview for php variable undefined inside function argument by the best coders in the world

showing results for - "php variable undefined inside function argument"
Ilyas
14 Mar 2019
1    <?php
2    // $ime=$_POST["ime"];
3    // $prezime=$_POST["prezime"];
4    $pera="string";
5    $prezime = "Ne radi, vrati se nazad i unesi nesto!";
6    // if (empty($ime)||empty($prezime)){
7    //     echo "Ne radi, vrati se nazad i unesi nesto!";
8    // }
9    $provera = function ($prom) use ($pera) {
10        if (preg_match("/[0-9\,\.\?\>\.<\"\'\:\;\[\]\}\{\/\!\\\@\#\$\%\^\&\*\(\)\-\_\=\+\`[:space:]]/",$prom)){
11            echo "Nepravilan unos imena ili prezimina!";
12            echo $pera;
13        }
14    };
15
16    // $provera($ime);
17    $provera($prezime);
18
Caterina
20 Aug 2018
1$myId = 0;
2function run(){
3  global $myId;
4	echo $myId;
5}