undefined variable inside function php

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

showing results for - "undefined variable inside function php"
Cali
08 Mar 2017
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
Romina
09 Jan 2017
1$myId = 0;
2function run(){
3  global $myId;
4	echo $myId;
5}