Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php variable undefined inside function argument

    <?php
    // $ime=$_POST["ime"];
    // $prezime=$_POST["prezime"];
    $pera="string";
    $prezime = "Ne radi, vrati se nazad i unesi nesto!";
    // if (empty($ime)||empty($prezime)){
    //     echo "Ne radi, vrati se nazad i unesi nesto!";
    // }
    $provera = function ($prom) use ($pera) {
        if (preg_match("/[0-9,.?>.<"':;[]}{/!@#$\%^&*()-\_=+`[:space:]]/",$prom)){
            echo "Nepravilan unos imena ili prezimina!";
            echo $pera;
        }
    };

    // $provera($ime);
    $provera($prezime);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #variable #undefined #function #argument
ADD COMMENT
Topic
Name
8+7 =